X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Wed, 10 Mar 2010 10:59:29 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Cygwin 1.7: Concurrency Issue with Shared State Initialization Message-ID: <20100310095929.GY6505@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On Mar 10 10:55, Schmidt, Oliver wrote: > Hi Corrina, > > Thanks for your involvement :-) > > >> [...] a spinlock [...] With > >> InterlockedCompareExchange() and Sleep() it should be quite simple to > >> create one that's very efficient in the usual scenario. > > > Does the below patch fix this for you? > > I'll test the snapshot asap! > > [...] > + LONG init = InterlockedCompareExchange (&installation_root_init, 1L, 0L); > [...] > + low_priority_sleep (0); > [...] > > I see we were thinking along the same lines ;-) The final patch is from cgf. It's probably more performant since it drops the requirement for an additional spinlock. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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