non rentrant functions causing thread safe function crashes.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

non rentrant functions causing thread safe function crashes.

Jeremy Linton
Hi,

I've been lurking for a while but I have a specific problem with glibc
that doesn't occur on other unix's.

In general, is it acceptable behavior for a function marked as non
reentrant to cause cause side affects in routines that are required to
be thread safe? In particular, should I be concerned about crashes in
thread safe library functions if I call a function that isn't required
to be thread safe in another thread (even once?).

I can't find anything in the standard which implies this, rather I find
the opposite. The standard makes it clear that every effort should be
made to get correct behavior in a threaded environment even for routines
that aren't _required_ to be thread safe. There isn't a single function
marked as never being thread safe.

Basically, because of this problem I'm concerned that I should _NEVER_
use any function marked as non reentrant in a threaded program.