This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Non thread safe primitives
- From: "John Zoidberg" <the dot real dot doctor dot zoidberg at gmail dot com>
- To: libc-alpha at sourceware dot org
- Date: Wed, 6 Dec 2006 09:15:37 +0000
- Subject: Non thread safe primitives
Hi,
I've read on the FAQ that glibc 2 is by default thread-safe. But on
the manual it is mentioned on several primitives that they are not
thread safe, so the <fname>_r primitive should be used instead, but
there are even other primitives that do not seem to have a _r sibling.
Moreover, on the CHANGELOG there are references like "in glibc 2.x.x
functionality foo is now thread safe".
My "yes-or-no" questions are:
1) is glibc fully thread safe or not?
2) is the standard C library (this includes I/O) part of it fully thread safe?
3) do the _THREAD_SAFE and _REENTRANT macros converts foo() to foo_r()
automatically, abstracting the user from doing it and thus making the
code thread safe?
Thanks in advance!