> Does anyone have experience on the thread-safty issue with malloc()?
ANSI C does not have threads, so no functions are guaranteed thread-safe.
ANSI C does not guarantee that malloc() is reentrant (usable from a
signal handler).
>Some people said this function provided in stdlib.h is not thread-
>safe, but someone said it is thread safe.
WHOSE stdlib.h? It is also quite possible that malloc() is thread-safe
if you link with the thread-safe library, and not if you don't, in
the same implementation and use the same copy of stdlib.h. The same
also may apply to things like the thread-safe version of getc(), putc(),
>Is it possible this
>function evolves from thread-unsafe to thread-safe in recent years?
>How could i find out?
Functions do not evolve, especially not from VMS to Solaris. However,
it might help to read the do***entation that came with your system.
> I am using the C library coming with GNU linux distribution.
I'm sure there are plenty of versions of that.
--
comp.lang.c.moderated - moderation address: clcm@[EMAIL PROTECTED]
-- you must
have an appropriate newsgroups line in your header for your mail to be
seen,
or the newsgroup name in square brackets in the subject line. Sorry.


|