Web lists-archives.com

Re: No thread safety in clock_gettime (hires_ns::prime)

On Mon, 26 Nov 2018 18:01:40, Corinna Vinschen  wrote:
> On Nov 23 11:27, James E. King III wrote:

> > I found that a call to
> > clock_gettime(CLOCK_MONOTONIC, ..) has a one-time initialization that
> > is not thread-safe.  If two threads call this at the same time, they
> > will race.  The results I am seeing are typically that one of the two
> > callers get a timespec structure with zero values, and no error return
> > code from the call.
> Thanks for the testcase, but I can't reproduce the problem, neither on
> 32 bit nor on 64 bit.  I tweaked your makefile to have a 100K loop I
> started multiple times with differently optimzed code, but to no avail.

I can, easily. (Windows 7, 64-bits. Unmodified Makefile.)


Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple