From owner-freebsd-questions Thu Jul 20 16:42:51 2000 Delivered-To: freebsd-questions@freebsd.org Received: from ns.tar.com (ns.tar.com [204.95.187.2]) by hub.freebsd.org (Postfix) with ESMTP id F260937B7D0 for ; Thu, 20 Jul 2000 16:42:46 -0700 (PDT) (envelope-from dick@tar.com) Received: from test.tar.com (test [204.95.187.4]) by ns.tar.com (8.9.3/8.9.3) with ESMTP id SAA64853; Thu, 20 Jul 2000 18:42:42 -0500 (CDT) (envelope-from dick@tar.com) Received: by test.tar.com (Postfix, from userid 1000) id 8394581D4E; Thu, 20 Jul 2000 18:42:41 -0500 (CDT) Date: Thu, 20 Jul 2000 18:42:41 -0500 From: "Richard Seaman, Jr." To: Alfred Perlstein Cc: Tan Juay Kwang , freebsd-questions@FreeBSD.ORG Subject: Re: pthreads on 4.0-STABLE Message-ID: <20000720184241.E404@tar.com> References: <20000720162831.B404@tar.com> <20000720173001.C404@tar.com> <20000720155412.R13979@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20000720155412.R13979@fw.wintelcom.net>; from bright@wintelcom.net on Thu, Jul 20, 2000 at 03:54:12PM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Jul 20, 2000 at 03:54:12PM -0700, Alfred Perlstein wrote: > Shouldn't it be an easy enough hack to use pthread_once along with > pthread_get/set_specific when _THREAD_SAFE is defined in gethostbyname? Sure. Of course, you really need to deal with gethostbyaddr, and probably a number of other calls too. Plus, since a number of other threads packages have the "_r" functions, for portability reasons you will probably want to still implement these. Also, this allows you to pass pointers globaly without worrying about whether the thread that owns the thread specific data has gone away. -- Richard Seaman, Jr. email: dick@tar.com 5182 N. Maple Lane phone: 262-367-5450 Nashotah WI 53058 fax: 262-367-5852 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message