Date: Mon, 12 Aug 2002 16:59:25 -0700 (PDT) From: David Xu <bsddiy@yahoo.com> To: Terry Lambert <tlambert2@mindspring.com>, Maxim Sobolev <sobomax@FreeBSD.org> Cc: "hackers@FreeBSD.ORG " <hackers@FreeBSD.ORG>, "audit@FreeBSD.ORG" <audit@FreeBSD.ORG>, Alexander Litvin <archer@whichever.org>, Andriy Gapon <agapon@excite.com> Subject: Re: Thread-safe resolver [patches for review] Message-ID: <20020812235925.98910.qmail@web20908.mail.yahoo.com>
next in thread | raw e-mail | index | archive | help
> > No. I don't think any of the _r functions are needed, so long > as the results are not cached by pointer instead of a copy, > before passing them from one thread to another. It's a risk on > the clobber case of a call with a cached reference outstanding > but not processed by another thread which is not an issue with > the _r functions, which require that you pass the storage down. > > Of course, if you pass down per thread storage, you could have > the same problem if you didn't copy rather than reference the > results before passing to another thread by address. > > Given that, per thread allocations ("thread local storage") > makes more sense than allocate/free fights between threads > based on who's responsible for owning the memory after an > inter-thread call. 8-). > > -- Terry localtime() etc. are candidate to make them use per thread storage. David Xu __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020812235925.98910.qmail>