[PATCH v3] i386: Use pthread_barrier for synchronization on tst-bz21269

DJ Delorie dj@redhat.com
Thu Mar 2 20:21:22 GMT 2023


Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> writes:
>> +      /* Give the thread a chance to get into it's busy loop.  */
>> +      usleep (5);
>
> ... I shivers every time I see sleep used as synchronization mechanism, since
> most likely in some environment the sleep won't work as expected due
> scheduling pressuer and we will end up with a false positive.

Yeah, I'm using as just a "yeild if you can" operation.  The code works
without it, but not in the way the test is intended.

> I am wondering if it would be better to just remove this test saying we
> can't really make it work reliable.

I'm not opposed to removing it.  Even with the fixed I put in, the test
is still more likely to fault "for some reason" than for the expected
reason.



More information about the Libc-alpha mailing list