On 11/20/09, Christopher Faylor <cgf-use-the-mailinglist-ple...@cygwin.com> wrote: > On Fri, Nov 20, 2009 at 01:19:57PM -0500, mike marchywka wrote: >>On 11/20/09, Corinna Vinschen wrote: >>> On Nov 20 09:32, Christopher Faylor wrote: >>>> On Fri, Nov 20, 2009 at 12:20:52PM +0100, Corinna Vinschen wrote: >>>> >On Nov 20 06:04, mike marchywka wrote: >>>> >> On 11/19/09, Larry Hall (Cygwin) <reply-to-list-only...@cygwin.com> >>>> >> wrote: >>>> >>>Wow! I had a hunch that BLODA could be the cause of the file related >>>> >>>problems but it never occurred to me that it could be screwing up >>>> >>>environment variables too. >>>> >> >>>> >>Anyone care to determine if env updates are not thread safe? >>>> > >>>> >It's indeed not thread safe. Looks like we need some locking... >>>> >>>> What's "it" in this case? putenv? >>> >>> "it" is primarily _addenv, which is used by setenv and putenv. >>> >>>> The putenv() function is not required to be reentrant, and the one in >>>> libc4, libc5 and glibc 2.0 is not, but the glibc 2.1 version is >>> >>> Same for setenv and unsetenv, which don't need to be thread-safe per >>> POSIX. glibc's setenv is thread-safe, though. >>> >>>> I agree that it would be nice to make it safer but is there really code >>>> here which is updating the environment in separate threads? >>> >>> 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. 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? I guess my point is that there is nothing cygwin can do if windoze doesn't do it. But, that was why I asked what the OP was actually complaining about. In may case, IIRC, I got garbage in the windoze variables rather than just some from process A and some from process B. > -- -- 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