This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: clone() + glibc thread safe?
- From: Arjan van de Ven <arjan at infradead dot org>
- To: Russell Leighton <russ at elegant-software dot com>
- Cc: linux-kernel at vger dot kernel dot org, libc-alpha at sources dot redhat dot com
- Date: Thu, 12 Jan 2006 08:28:30 +0100
- Subject: Re: clone() + glibc thread safe?
- References: <43C5B393.1010600@elegant-software.com>
On Wed, 2006-01-11 at 20:40 -0500, Russell Leighton wrote:
> Can you safely use glibc functions in a thread safe way (e.g., malloc()
> and friends) from threads generated by:
>
> clone(f, stack, CLONE_FS|CLONE_FILES|CLONE_VM, t)
no
unless you tell glibc you're using threads (by using the glibc threading
primitives) glibc doesn't provide such thread safety.
(glibc at runtime knows you have threads and switches to thread-safe
operations)