X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:reply-to:to:subject :references:in-reply-to:content-type; q=dns; s=default; b=Xr4tzt oSM+0EbUu5v++dhJi4RK0BwAVN20Imw36Rz/mVMX9JdMeSnpZRcYfD0sH8xjlEGt Dz9dsq8mldJU+UjuvRHCQC7THePlmlazJNM+11/H02Z5snldaaoY15658xAd+sEg IdKNKF9fF2jxaxQPItOtlW+5VZg/6IkO/hz5k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:reply-to:to:subject :references:in-reply-to:content-type; s=default; bh=huvBrCAV93H2 /enbhIPyV1rTkmM=; b=s/s4+SbFD1HMquNgOSFOybKLdIe8T2Zh8qDFRJPXtYMz XqzrGlCH8sOoIvlVriaRMJpZfYiefA1UXysL3phkprLFzAmht6ICvLNA+3RkBKwL Hh0TcvEARfN0IM4cLsdvaSd0b3BQ52z4Dd8y/GqOVkXL5mgtMKzLwbyg+Jp8I0A= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*M:smtp, Hx-languages-length:795, H*F:D*nl X-HELO: lb1-smtp-cloud7.xs4all.net Date: Mon, 26 Nov 2018 18:38:25 +0100 Message-ID: From: Houder Reply-To: cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com Subject: Re: No thread safety in clock_gettime (hires_ns::prime) References: <20181126170140 DOT GO30649 AT calimero DOT vinschen DOT de> In-Reply-to: <20181126170140.GO30649@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8; format=fixed User-Agent: mua.awk 0.99 On Mon, 26 Nov 2018 18:01:40, Corinna Vinschen wrote: > > On Nov 23 11:27, James E. King III wrote: [snip] > > 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.) Henri -- 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