climber.cui@[EMAIL PROTECTED]
wrote:
>
> Hi all,
> Does anyone have experience on the thread-safty issue with malloc()?
> Some people said this function provided in stdlib.h is not thread-
> safe, but someone said it is thread safe. Is it possible this
> function evolves from thread-unsafe to thread-safe in recent years?
> How could i find out?
> I am using the C library coming with GNU linux distribution.
It depends on the implementation, so a generic "yes it is" or "no it
is not" answer can't be given. However, if the implementation itself
sup****ts threads, the odds are it will supply a thread-safe version.
(A simple "man malloc" on your system may tell you.) I can tell you
that, on my system, if I tell the compiler I will be using threads,
it links with a thread-safe version of the runtime library, including
a thread-safe malloc().
--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@[EMAIL PROTECTED]
>
--
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.


|