Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030257AbWALH2f (ORCPT ); Thu, 12 Jan 2006 02:28:35 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030280AbWALH2f (ORCPT ); Thu, 12 Jan 2006 02:28:35 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:24253 "EHLO pentafluge.infradead.org") by vger.kernel.org with ESMTP id S1030257AbWALH2f (ORCPT ); Thu, 12 Jan 2006 02:28:35 -0500 Subject: Re: clone() + glibc thread safe? From: Arjan van de Ven To: Russell Leighton Cc: linux-kernel@vger.kernel.org, libc-alpha@sources.redhat.com In-Reply-To: <43C5B393.1010600@elegant-software.com> References: <43C5B393.1010600@elegant-software.com> Content-Type: text/plain Date: Thu, 12 Jan 2006 08:28:30 +0100 Message-Id: <1137050911.2936.0.camel@laptopd505.fenrus.org> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 694 Lines: 18 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) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/