From: Angus Dorbie (dorbie++at++sgi.com)
Date: 04/17/2001 14:50:58
The answer depends on what you mean by thread. Are we talking pthreads
sprok or fork?
I'm on vacation so I probably won't followup.
Cheers,ANgus.
"Volz, Bill (WRVO)" wrote:
>
> A slightly off topic question: Is malloc thread safe?
>
> I have an app that allocates memory in the main and frees it in a thread
> before it dies. I'm getting symptoms of memory corruption. When I free the
> memory in the main, the problems disappear. The books I have installed show
> thread occurring only three times and none of the man pages on malloc says
> anything about threading. I tried malloc_ss.so and it didn't indicate any
> memory problems, even though they still occurred. The man page for pthreads
> indicate malloc is not thread safe since sbrk is not thread safe, but it
> doesn't say anything about free.
>
> What about fwrite? Are the I/O routines thread safe (assuming only one
> thread is writing to a stream).
>
> Thanks,
>
> William R Volz - Senior Research Geophysicist
> Chevron Petroleum Technology
> Voice: 281-596-2059 Fax: 281-596-3009
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
-- For Performer+OpenGL tutorials http://www.dorbie.com/"Whenever there is a conflict between human rights and property rights, human rights must prevail." --Abraham Lincoln
This archive was generated by hypermail 2b29 : Tue Apr 17 2001 - 14:51:38 PDT