GNU bug report logs - #7073
no pthread_spinlock_t on Mac OS 10.6.4

Previous Next

Package: coreutils;

Reported by: "Gary V. Vaughan" <gary <at> gnu.org>

Date: Mon, 20 Sep 2010 05:52:01 UTC

Severity: normal

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> CS.UCLA.EDU>
To: Chen Guo <chen.guo.0625 <at> gmail.com>
Cc: bug-coreutils <at> gnu.org, bug-gnulib List <bug-gnulib <at> gnu.org>, Pádraig Brady <P <at> draigbrady.com>, "Gary V. Vaughan" <gary <at> gnu.org>
Subject: bug#7073: no pthread_spinlock_t on Mac OS 10.6.4
Date: Mon, 20 Sep 2010 16:38:07 -0700
On 09/20/10 14:38, Chen Guo wrote:

> How difficult would it be to implement a basic spinlock in gnulib, though?

Portably?  I'd think it'd be quite a pain, as it would require
figuring out this platform's atomic instructions, dealing with memory
barriers, and the like.

> I suppose a performance hit with mutexes beats no performance at all
> with missing spinlocks.

Yes.

> And regarding "take more work," I believe spinlocks and mutexes were
> basically interchangeable in terms of functionality in our sort
> algorithm; the work probably will be little more than a few #ifdefs
> and a s/pthread_mutex_t/pthread_spinlock_t/

Is that a reasonably-valid replacement in general, for code that uses
spin locks?  If so, we should implement this inside gnulib's pthread
module.  If not, it needs to be done inside coreutils, or perhaps
as a separate gnulib module.





This bug report was last modified 6 years and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.