From owner-freebsd-audit Mon Aug 12 16:59:30 2002 Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 029A837B400 for ; Mon, 12 Aug 2002 16:59:26 -0700 (PDT) Received: from web20908.mail.yahoo.com (web20908.mail.yahoo.com [216.136.226.230]) by mx1.FreeBSD.org (Postfix) with SMTP id 37E5943E42 for ; Mon, 12 Aug 2002 16:59:25 -0700 (PDT) (envelope-from bsddiy@yahoo.com) Message-ID: <20020812235925.98910.qmail@web20908.mail.yahoo.com> Received: from [210.83.128.34] by web20908.mail.yahoo.com via HTTP; Mon, 12 Aug 2002 16:59:25 PDT Date: Mon, 12 Aug 2002 16:59:25 -0700 (PDT) From: David Xu Subject: Re: Thread-safe resolver [patches for review] To: Terry Lambert , Maxim Sobolev Cc: "hackers@FreeBSD.ORG " , "audit@FreeBSD.ORG" , Alexander Litvin , Andriy Gapon MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > 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-audit" in the body of the message