From owner-freebsd-current Thu Sep 18 06:08:45 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA04422 for current-outgoing; Thu, 18 Sep 1997 06:08:45 -0700 (PDT) Received: from freebsd1.cimlogic.com.au ([203.36.2.25]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id GAA04415 for ; Thu, 18 Sep 1997 06:08:35 -0700 (PDT) Received: (from jb@localhost) by freebsd1.cimlogic.com.au (8.8.5/8.8.5) id XAA08877; Thu, 18 Sep 1997 23:09:30 GMT From: John Birrell Message-Id: <199709182309.XAA08877@freebsd1.cimlogic.com.au> Subject: Re: Thread safe libc In-Reply-To: from Ian Hungerford at "Sep 17, 97 02:35:18 pm" To: ianh@saturn-tech.com (Ian Hungerford) Date: Thu, 18 Sep 1997 23:09:29 +0000 (GMT) Cc: jb@cimlogic.com.au, freebsd-current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Ian Hungerford wrote: > OK, I'm on the job. :) Great. > > Some clarification is necessary for the second part, though. Should the > replacements for statics be allocated using thread specific data > (destroyed when the thread terminates) or malloc() (with the caller > assuming responsibility for the free() call)? I prefer the first method - > the latter is indescribably ugly, and programs that want to pass pointers > to these objects between threads should simply use the new _r functions. Like you, I prefer that the replacements for the statics be allocated with thread specific data, then they call the appropriate _r function. This allows the code to behave within each thread as though that thread were the only one. I don't think we should worry too much about how the replacements for the statics behave *between* threads, because a threaded program should really be using the _r functions. > --- > Ian > > Regards, -- John Birrell - jb@cimlogic.com.au; jb@netbsd.org; jb@freebsd.org CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137