Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C Moderated > Re: Is malloc()...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 8 Topic 1085 of 1134
Post > Topic >>

Re: Is malloc() function provided in <stdlib.h> thread-safe?

by Kenneth Brody <kenbrody@[EMAIL PROTECTED] > May 5, 2008 at 04:00 PM

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.
 




 8 Posts in Topic:
Is malloc() function provided in thread-safe?
climber.cui@[EMAIL PROTEC  2008-04-21 13:20:27 
Re: Is malloc() function provided in thread-safe?
Thomas Richter <thor@[  2008-05-05 16:00:54 
Re: Is malloc() function provided in thread-safe?
Kenneth Brody <kenbrod  2008-05-05 16:00:57 
Re: Is malloc() function provided in thread-safe?
gordonb.cp95r@[EMAIL PROT  2008-05-05 16:01:01 
Re: Is malloc() function provided in thread-safe?
Barry Schwarz <schwarz  2008-05-05 16:01:08 
Re: Is malloc() function provided in thread-safe?
=?utf-8?Q?Dag-Erling_Sm=C  2008-05-05 16:01:20 
Re: Is malloc() function provided in thread-safe?
Kalle Olavi Niemitalo <  2008-05-05 16:01:22 
Re: Is malloc() function provided in thread-safe?
Andrei Voropaev <avoro  2008-05-05 16:01:28 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 15:59:19 CDT 2008.