[openbeos] Re: POSIX thread safety, was: Re: Waiting and waiting

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Tue, 10 Dec 2002 11:38:13 +0100 CET

alan@xxxxxxxxxxxxxx (Alan Ellis) wrote:
> I believe that the whole of the BeOS standard library was thread 
> safe,
> and applications expect it to be.

No, just those functions which has to be.

> I have never once seen anyone using special thread safe functions in 
> a
> BeOS application.
> 
> There were even changes to the C++ library (std::string for one) so 
> that
> there was thread safety.
> 
> Could you give me an example of a functiont that was not meant to be
> thread safe? I would like to do some testing of your assumptions 
> under
> the current BeOS (Dano actually_/

Well, that's all written down in the POSIX standard; example of non 
thread-safe functions are (in no particular order): localtime(), 
asctime(), ctime(), ttyname(), all random functions, strerror(), etc.
OTOH they took a GPLd malloc()/free() - and they made it thread-safe, 
because it was not.

Of course, we will make sure that every function which uses a global 
variable is thread-safe if it has to be. I just don't think there are 
many examples where this is (or will be) necessary.

Adios...
   Axel.



Other related posts: