[openbeos] Re: Waiting and waiting

En réponse à Michael Phipps <mphipps1@xxxxxxxxxxxxxxxx>:

> Would you think that this would apply to things like strtok?
> That would be a good example for testing...
> 

This one is the perfect example of self-contained function (not dealing with
IO or anything) that doesn't need to be taken care of. Except of course if
you implement it using global variables, but this would be very dumb :^)

as long as it uses local variables *only* it can be considered as 
intrinsically thread-safe, as each instance is fully located on the stack of 
the calling thread.

On the opposite every function that deals with something that belongs to a 
whole team (memory, files, ...) must use locking (malloc(), fread, ...)

François.

Other related posts: