delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/11/21/08:48:16

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Sat, 21 Nov 2009 14:47:07 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Use of Dual Core causes random failures building OpenJDK
Message-ID: <20091121134707.GC29173@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4B061709 DOT 2040507 AT cygwin DOT com> <b0ddfae80911200304l4f23bca2ha548ee1030a7816b AT mail DOT gmail DOT com> <20091120112052 DOT GT29173 AT calimero DOT vinschen DOT de> <20091120143237 DOT GD18289 AT ednor DOT casa DOT cgf DOT cx> <20091120144958 DOT GW29173 AT calimero DOT vinschen DOT de> <b0ddfae80911201019m4832a7f9k684b502b52a05ce3 AT mail DOT gmail DOT com> <20091120184906 DOT GA27241 AT ednor DOT casa DOT cgf DOT cx> <b0ddfae80911201104g705e4a1bkb2bd526a50eb8ea2 AT mail DOT gmail DOT com> <20091121121218 DOT GZ29173 AT calimero DOT vinschen DOT de> <b0ddfae80911210516t36d42aadj6496b054a9f694c8 AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <b0ddfae80911210516t36d42aadj6496b054a9f694c8@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 Nov 21 08:16, mike marchywka wrote:
> On 11/21/09, Corinna Vinschen <corinna-cygwin AT cygwin DOT com> wrote:
> > On Nov 20 14:04, mike marchywka wrote:
> >> 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
> >
> 
> well, the question was somewhat rhetorical/disingenuous but
> I don't see how in the general case then the OS can allow two
> simultaneous processes to modify windoze env variables in a way
> that corrupts them. The app is responsible for itself but I'm not sure
> what it can do with respect to other processes. If you wanted an emulation
> layer to be safe you are still limited by the OS( but you may have already
> known that LOL).

The environment, even the so-called Windows environment, is just a
memory blob in the application's memory space.  It's not shared between
processes or something, only inherited.  If it's corrupted, the reason
is that the environment has been scrambled in this process, or in one of
the parent processes prior to the fork/exec calls.  The OS has usually
nothing to do with that, and as far as the Windows environment of a
process is concerned, the Windows system calls to change the environment
*are* thread-safe.


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019