From owner-freebsd-current@FreeBSD.ORG Wed Dec 10 12:04:39 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 85CDF16A4CE; Wed, 10 Dec 2003 12:04:39 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8621143D29; Wed, 10 Dec 2003 12:04:38 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hBAK4bml000322; Wed, 10 Dec 2003 15:04:37 -0500 (EST) Date: Wed, 10 Dec 2003 15:04:37 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: "Jacques A. Vidrine" In-Reply-To: <20031210170815.GA77342@madman.celabo.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: current@FreeBSD.org Subject: Re: nss and pthreads and wine, oh my! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2003 20:04:39 -0000 On Wed, 10 Dec 2003, Jacques A. Vidrine wrote: > On Wed, Dec 10, 2003 at 12:39:59AM -0500, Daniel Eischen wrote: > > Yes, I think libc should only call locking primitives when > > __isthread != 0. > > Hi Dan, > > You don't mean that, do you? You seem to be implying that pthread > functions would have to be invoked in libc something like this: > > result = __isthreaded ? _pthread_mutex_trylock(&foo_lock) : 0; > if (result != 0) > /* error */; > > or use the macros in reentrant.h. > > But, maybe I'm just misunderstanding you. I believe the thread > functions are `stubbed out' in the non-thread case? They are, but when libpthread is linked in, even if threads are not created, there's no reason to call the pthread sync functions if we're not threaded. There is a bit of overhead associated with calling these things that can be avoided simply by checking __isthreaded. -- Dan Eischen