At 11:04 PM 1/21/01 +0000, Alan Burlison wrote:
>Dan Sugalski wrote:
>
> > I'm torn between doing that and not, since firing up a second OS-level
> > thread can add some overhead that we might not need with the "set a flag
> > and check on op boundary" setup. I know that VMS won't kick over to the
> > slower fully threadsafe version of its runtime libraries until you actually
> > start a second thread, and I thought Solaris did something similar.
>
>It's linking to libthread that makes it use the thread-safe versions of
>stuff:

Ah, different than what I expected. ISTR some systems (possibly just the 
Digital ones) do some odd things with the libraries, basically having the 
whole runtime library being vectored, and firing off a thread changed the 
vectors from the non-threaded to the threaded version. Makes writing 
thread-agnostic code easier, since you can do locking if you need to but 
don't necessarily have to slow down the entire RTL system. (No need for 
malloc to lock, for example, in single-threaded code, since there's nothing 
that could require them be taken as you're, well, single threaded)

I could be talking out my hat, though, as it's been a while and my memory's 
an interesting thing. ("reliable" is not an appropriate adjective for it... :)

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to