[PATCH] Fix sporadic failure in g++.dg/tsan/aligned_vs_unaligned_race.C
Jakub Jelinek
jakub@redhat.com
Wed Jan 7 17:00:00 GMT 2015
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
More information about the Gcc-patches
mailing list