X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Sat, 21 Nov 2009 13:12:18 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Use of Dual Core causes random failures building OpenJDK
Message-ID: <20091121121218.GZ29173@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <4B023172.5000102@a11ysoft.com>  <4B0611DC.3080002@a11ysoft.com>  <4B061709.2040507@cygwin.com>  <b0ddfae80911200304l4f23bca2ha548ee1030a7816b@mail.gmail.com>  <20091120112052.GT29173@calimero.vinschen.de>  <20091120143237.GD18289@ednor.casa.cgf.cx>  <20091120144958.GW29173@calimero.vinschen.de>  <b0ddfae80911201019m4832a7f9k684b502b52a05ce3@mail.gmail.com>  <20091120184906.GA27241@ednor.casa.cgf.cx>  <b0ddfae80911201104g705e4a1bkb2bd526a50eb8ea2@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <b0ddfae80911201104g705e4a1bkb2bd526a50eb8ea2@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@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

On Nov 20 14:04, mike marchywka wrote:
> On 11/20/09, Christopher Faylor wrote:
> > On Fri, Nov 20, 2009 at 01:19:57PM -0500, mike marchywka wrote:
> >>On 11/20/09, Corinna Vinschen  wrote:
> >>> And given POSIX, if so, it would be an application bug if the application
> >>> doesn't care by itself to use setenv/getenv in a thread-safe manner.
> >>
> >>Why does the OS let this happen?  I thought windoze should avoid
> >>garbage.
> >
> > Er, I think you're a little confused about what we're talking about.  The
> > OS doesn't enforce thread safety.  There's really no way that it can.
> 
> We are talking about windoze env variables right? I did ask previously
> I thought.

We're only talking about Windows env variables if non-Cygwin processes
are involved.  As long as only Cygwin processes are involved in the
process, env variables are inherited via a Cygwin mechanism, not via
the Windows environment.

> The OS is the only place you can when the threads are in different
> processes unknown to each other. Or, can two different processes share
> the
> same thread?

No, never.  If there is a concurrency problem with the envionment, it's
between threads of the same process.  In that case, we can make getenv,
setenv and friends thread-safe, but it's still actually a problem of the
application, given that getenv, setenv and friends are not thread-safe
per POSIX.  See
http://www.opengroup.org/onlinepubs/9699919799/functions/setenv.html
http://www.opengroup.org/onlinepubs/9699919799/functions/getenv.html
http://www.opengroup.org/onlinepubs/9699919799/functions/unsetenv.html


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

