List of reentrant C/C++ functions

T

TheOne

Would anyone please point me to a list of reentrant GNU C/C++ library
functions? I have searched a lot on the web for it but without any
success. Man page of signal(2) has listed system calls (POSIX
1003.1-2003 list) which are safe(reentrant) but thats not sufficient
for my purpose.

Thanks in advance.
 
I

Ivan Vecerina

: Would anyone please point me to a list of reentrant GNU C/C++ library
: functions? I have searched a lot on the web for it but without any
: success. Man page of signal(2) has listed system calls (POSIX
: 1003.1-2003 list) which are safe(reentrant) but thats not sufficient
: for my purpose.
:
: Thanks in advance.
Regarding the GNU implementation, you should ask on a dedicated
forum (clc++ is dedicated to the standard C++ language).
The C++ standards says nothing about multi-threaded or multi-
process platforms, so it is all platform-specific.

This said, on all major platforms, fully reentrant
implementations of the standard library are available.
This will usually be the case of GNU C/C++ as well,
although single-threaded libs (e.g. for malloc etc)
may also exist on some platforms.

Some standard C functions are known to be incompatible
with a reentrant implementation, because they use
static storage. These include strtok and gmtime, and
some functions altering the 'locale' settings.
Those calls can usually be avoided (or, occasionally,
accessed serially only by locking an associated mutex).
However, this requires using platform-specific techniques.


hth-Ivan
 
M

Maxim Yegorushkin

Ivan Vecerina wrote:

[]
Some standard C functions are known to be incompatible
with a reentrant implementation, because they use
static storage. These include strtok and gmtime, and
some functions altering the 'locale' settings.
Those calls can usually be avoided (or, occasionally,
accessed serially only by locking an associated mutex).
However, this requires using platform-specific techniques.

More of that, on platforms like Windoze those are not reentrant but
thread-safe since they use TLS for their statics.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top