X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-10.6 required=5.0 	tests=BAYES_00,RCVD_IN_DNSWL_HI
X-Spam-Check-By: sourceware.org
From: "Schmidt, Oliver" <oliv.schmidt@sap.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Date: Tue, 9 Mar 2010 11:08:22 +0100
Subject: RE: Cygwin 1.7: Concurrency Issue with Shared State Initialization
Message-ID: <B10B50309DC54D45A855FD66F56015F71D07C79605@DEWDFECCR03.wdf.sap.corp>
References: <B10B50309DC54D45A855FD66F56015F71D07C78CAE@DEWDFECCR03.wdf.sap.corp>  <20100308195656.GA17237@ednor.casa.cgf.cx>
In-Reply-To: <20100308195656.GA17237@ednor.casa.cgf.cx>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Hi Christopher,

Fist of all thanks for your immediate feedback :-)

>>    /* Initialize installation root dir. */
>>     if (!installation_root[0])
>>       init_installation_root ();

> I'll check in something tonight which attempts to solve this problem.

Thanks in advance.

> It's a somewhat tricky problem because adding a mutex here would slow
> down every invocation of a cygwin program and we don't want to add to
> the "Why is Cygwin so slow???" scenarios if we can help it.

I understand your concern for sure ;-)

Maybe that's the very thing you're thinking about but ... AFAIK a spinlock =
is the usual paradigm in scenarios where one doesn't anticipate contention =
but needs to be aware of it 'just in case'. With InterlockedCompareExchange=
() and Sleep() it should be quite simple to create one that's very efficien=
t in the usual scenario.

Regards, Oliver

--
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

