Date: Thu, 18 Sep 1997 23:09:29 +0000 (GMT) From: John Birrell <jb@cimlogic.com.au> To: ianh@saturn-tech.com (Ian Hungerford) Cc: jb@cimlogic.com.au, freebsd-current@FreeBSD.ORG Subject: Re: Thread safe libc Message-ID: <199709182309.XAA08877@freebsd1.cimlogic.com.au> In-Reply-To: <Pine.BSF.3.95.970917142907.6836A-100000@hobbes.saturn-tech.com> from Ian Hungerford at "Sep 17, 97 02:35:18 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709182309.XAA08877>