Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Dec 2003 15:04:37 -0500 (EST)
From:      Daniel Eischen <eischen@vigrid.com>
To:        "Jacques A. Vidrine" <nectar@FreeBSD.org>
Cc:        current@FreeBSD.org
Subject:   Re: nss and pthreads and wine, oh my!
Message-ID:  <Pine.GSO.4.10.10312101458230.27852-100000@pcnet5.pcnet.com>
In-Reply-To: <20031210170815.GA77342@madman.celabo.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10312101458230.27852-100000>