pthreads-hackers
[Top][All Lists]
Advanced

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

Re: [Pthreads-hackers] pthreads and cancellation


From: Jeroen Dekkers
Subject: Re: [Pthreads-hackers] pthreads and cancellation
Date: Sat, 26 Jan 2002 20:57:51 +0100
User-agent: Mutt/1.3.25i

On Sat, Jan 26, 2002 at 06:49:54PM +0100, Marcus Brinkmann wrote:
> Small correction, to avoid race conditions, this must be a struct that
> contains a spin lock and a pointer to another struct, containing the rest
> of the structure.  It's unfortunate that just to support statically
> initialized condition variables, we have to acquire two spin locks to get at
> the condition variable.  But it can not be helped (well, it could be helped
> by an atomic int or pointer variable that signals the initialization
> status, so you would only need to get that lock if it is not yet
> initialized, and re-check the initialization status, as the status is not
> changed afterwards.  Unfortunately I don't think we have atomic ints
> generally available, do we?).

We've atomicity.h, but I'm not sure whether you could use the current
interface. You can always modify it or add some new operations.
The architectures which don't have the atomic operations will still
use spinlocks. See the following threads:

http://sources.redhat.com/ml/libc-hacker/1999-08/msg00139.html
http://sources.redhat.com/ml/libc-hacker/2000-01/msg00000.html

Jeroen Dekkers
-- 
Jabber supporter - http://www.jabber.org Jabber ID: address@hidden
Debian GNU supporter - http://www.debian.org http://www.gnu.org
IRC: address@hidden

Attachment: pgpo55V6vmGfS.pgp
Description: PGP signature


reply via email to

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