From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13914 invoked by alias); 7 Jan 2015 17:00:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 13860 invoked by uid 89); 7 Jan 2015 17:00:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 07 Jan 2015 17:00:35 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t07H0W6E026862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 7 Jan 2015 12:00:32 -0500 Received: from tucnak.zalov.cz (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t07H0VmM019216 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Wed, 7 Jan 2015 12:00:32 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t07H0SVj030996; Wed, 7 Jan 2015 18:00:29 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t07H0RrX030845; Wed, 7 Jan 2015 18:00:27 +0100 Date: Wed, 07 Jan 2015 17:00:00 -0000 From: Jakub Jelinek To: Mike Stump Cc: Bernd Edlinger , "H.J. Lu" , "gcc-patches@gcc.gnu.org" , Dmitry Vyukov Subject: Re: [PATCH] Fix sporadic failure in g++.dg/tsan/aligned_vs_unaligned_race.C Message-ID: <20150107170027.GV1667@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20150106091633.GF1667@tucnak.redhat.com> <20150107082339.GN1667@tucnak.redhat.com> <887DE6D6-D1D2-4432-B6F8-D55707BA2387@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <887DE6D6-D1D2-4432-B6F8-D55707BA2387@comcast.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg00332.txt.bz2 On Wed, Jan 07, 2015 at 08:58:04AM -0800, Mike Stump wrote: > On Jan 7, 2015, at 12:23 AM, Jakub Jelinek wrote: > > But I really don't like the busy waiting. > > We’ve already determined that sched_sleep isn’t intercepted and can be used to non-busy wait. Any reason not to use it? > > > As tsan is only supported on x86_64-linux > > So, I hate hardening the code to be overly non-portable when it doesn’t have to be that. There is something enticing to me about the simplicity of sched_sleep. Well, pthread_barrier_wait and dlopen/dlsym are already used by libtsan and therefore have to be supported on all the architectures that support tsan. So that method is as portable as libtsan itself. Jakub