[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: initialized state of capability objects should be locked

From: Neal H. Walfield
Subject: Re: initialized state of capability objects should be locked
Date: Mon, 17 Jan 2005 04:17:52 -0500
User-agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI)

> I don't think so.  Taking a mutex is, maybe not in our current
> implementations, but certainly at the abstract level, something that
> is inherently tied to the thread performing the operation.  A locked
> mutex would have to be unlocked by the thread taking the lock.  This
> disallows sharing a locked mutex object via a pool common to all
> threads.
> Now, you may be able to argue that our current pthread implementations
> don't actually make any distinction (for example, we may not implement
> checked mutex's etc).  But even if this is true (I haven't checked), I
> don't think this is a sane optimization to make (and for what I think
> are pretty obvious reasons).

You are right.

Our libpthread doesn't require that the same thread which locks a
mutex unlock it but using this knowledge will only get us into trouble
later for a trivial micro-optimization.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]