From owner-freebsd-questions Thu Jul 20 15:54:21 2000 Delivered-To: freebsd-questions@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 7299B37B528 for ; Thu, 20 Jul 2000 15:54:18 -0700 (PDT) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e6KMsCR23105; Thu, 20 Jul 2000 15:54:12 -0700 (PDT) Date: Thu, 20 Jul 2000 15:54:12 -0700 From: Alfred Perlstein To: "Richard Seaman, Jr." Cc: Tan Juay Kwang , freebsd-questions@FreeBSD.ORG Subject: Re: pthreads on 4.0-STABLE Message-ID: <20000720155412.R13979@fw.wintelcom.net> References: <20000720162831.B404@tar.com> <20000720173001.C404@tar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <20000720173001.C404@tar.com>; from dick@tar.com on Thu, Jul 20, 2000 at 05:30:01PM -0500 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Richard Seaman, Jr. [000720 15:41] wrote: > On Thu, Jul 20, 2000 at 04:28:31PM -0500, Richard Seaman, Jr. wrote: > > > Ideally, a threads package will provide gethostbyname_r, where you > > pass a buffer for the result so you can avoid having to wrap the > > call in a mutex. Unfortunately, I don't see this call in the > > FreeBSD user threads package. Such a call does exist in linuxthreads > > (as well as the FreeBSD linuxthreads port -- > > see /usr/ports/devel/linuxthreads). > > I forgot. You can also use the newer getaddinfo(3) call. This > is probably preferable, though I'm not sure about how portable > this is. 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? -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message