Subject: bug#7073: no pthread_spinlock_t on Mac OS 10.6.4

From: Bruno Haible <[email-masked]>
Date: Mon, 20 Sep 2010 11:24:55 +0200

Hi Paul,

> If MacOS doesn't have spinlocks, then from coreutils' point of view MacOS
> doesn't have proper thread support.

Usually in applications mutexes are used, not spinlocks. The comments in sort.c
say:

  "Note spin locks were seen to perform better than mutexes
   as long as the number of threads is limited to the
   number of processors."

In other words, spinlocks were chosen instead of mutexes only for performance
reasons.

So, instead of turning off the entire thread-based parallelization on MacOS X,
why not use mutexes instead of spinlocks on this platform?

Bruno