Date: Wed, 17 Sep 1997 14:35:18 -0600 (MDT) From: Ian Hungerford <ianh@saturn-tech.com> To: John Birrell <jb@cimlogic.com.au> Cc: freebsd-current@FreeBSD.ORG Subject: Re: Thread safe libc Message-ID: <Pine.BSF.3.95.970917142907.6836A-100000@hobbes.saturn-tech.com> In-Reply-To: <199709162326.XAA04662@freebsd1.cimlogic.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 16 Sep 1997, John Birrell wrote: > Ian, > > Your assessment is correct. The net code in libc needs work to add the > re-entrant calls which include the extra args to avoid the use of the > static variables. And then work is needed to make the traditional > functions with the static variables allocate those variables on a > per-thread basis so that they behave in the same way they do in a > sindle threaded program. OK, I'm on the job. :) 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. Just my $.02, of course - I'll implement it, however ugly it ends up needing to be. :) > 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 --- Ian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.970917142907.6836A-100000>