Subject: Re: B19: threads
From: [email-masked] (Geoffrey Noer)

21 Apr 1998 03:59:23 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
Content-Type: text
To: [email-masked]
Cc: [email-masked]

Steve Biskis wrote:
> 
> Whats the deal with all those:  _<somefunc>_r  procedures in the run-time
> that are supposed to protect the "reent" structure and make cygwinb19.dll
> thread-safe ???
[...]

I've seen some confusion on the list about thread-safeness with
respect to Cygwin32, so I'll try to clear it up.  Hopefully I won't
make it worse.  :-)

Newlib, which is the libc/libm library used by Cygwin32, was designed
to be thread-safe.  If there are any issues there, they should be
small and relatively easy to fix.

In terms of the code for the Cygwin32 DLL, Cygwin32 uses multiple
threads internally and does the necessary locking to allow that.
But this does not mean that it necessarily supports multi-threaded
programs.  This is because the threads inside the DLL have different
functions.  This is not guaranteed in an arbitrary multi-threaded
program.  I also do not know whether the newlib reentrancy is
supported by Cygwin32 properly.

As I mentioned a while ago, I think supporting multi-threaded
applications is relatively important for Cygwin32.  In the past, 
since Cygnus hasn't had to run any multi-threaded programs with
Cygwin32 (so far, at least), this work hasn't been a particularly high
priority.  This may change in the future though...

-- 
Geoffrey Noer
[email-masked]
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".