This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix sporadic failure in g++.dg/tsan/aligned_vs_unaligned_race.C
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Mike Stump <mikestump at comcast dot net>
- Cc: Bernd Edlinger <bernd dot edlinger at hotmail dot de>, "H.J. Lu" <hjl dot tools at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Dmitry Vyukov <dvyukov at google dot com>
- Date: Wed, 7 Jan 2015 18:00:27 +0100
- Subject: Re: [PATCH] Fix sporadic failure in g++.dg/tsan/aligned_vs_unaligned_race.C
- Authentication-results: sourceware.org; auth=none
- References: <DUB118-W1E901D082BACEDE02A5E8E4590 at phx dot gbl> <DUB118-W468072AA78C7E7CD1DCF6BE4590 at phx dot gbl> <20150106091633 dot GF1667 at tucnak dot redhat dot com> <DUB118-W15350AC346C8CE664A5ECDE4590 at phx dot gbl> <DEA45E76-18B8-4FCA-AFE3-718F21DC1CB3 at comcast dot net> <DUB118-W1417B0F343893BD17318BAE4590 at phx dot gbl> <A5E27EC0-33BE-4043-8B5E-07394E68AE41 at comcast dot net> <DUB118-W189C82F5D792A3B997EED5E4460 at phx dot gbl> <20150107082339 dot GN1667 at tucnak dot redhat dot com> <887DE6D6-D1D2-4432-B6F8-D55707BA2387 at comcast dot net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Jan 07, 2015 at 08:58:04AM -0800, Mike Stump wrote:
> On Jan 7, 2015, at 12:23 AM, Jakub Jelinek <jakub@redhat.com> 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