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

  • From: alan@xxxxxxxxxxxxxx (Alan Ellis)
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Tue, 10 Dec 2002 09:49:36 -0800

Heh, I think you mean the 'intrinsically' thread safe funcitons. They
don't have any thread safety issues, so there is no extra code to write
for them.

yes?

Alan

On Tue, Dec 10, 2002 at 11:38:13AM +0100, Axel =?iso-8859-1?q?D=F6rfler ?= 
wrote:
> 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: