On Sat, Jun 09, 2007 at 10:41:53PM +0300, Gilad Ben-Yossef wrote:

> The Futex mechanism in the kernel, which pthread_mutex_lock is using
> (assusming you use an NPTL based system, but I think you are) is
> known to have fairness issues with code that does tight loops that
> do lock/unlock sequences, at least on SMP systems.
> 
> I would try to add a sched_yield() between the unlock and lock in
> that while loop of yours.

The semantics of sched_yield() in some versions of 2.6 are not "let
someone else run before me", which is what most people expect, but
rather "let everyone else run before me", which would make the test
program meaningless.

Cheers,
Muli

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to