Re: Thread starvation with mutex

Luke Elliott <[email protected]> Fri, 06 Feb 2004 16:33:20 -0600
Newsgroups gmane.comp.lib.phil
Message-ID <[email protected]>
Forgot to mention that this is on a UP machine with HT disabled.

Can we call it "sensible" instead of fair..?! I think I'll go and read 
up on some standards. Is there a reason why NPTL does not use this 
"fair" method? Surely this is pretty normal, expected behaviour of a mutex?

Luke.

Jamie Lokier wrote:

>Jamie Lokier wrote:
>  
>
>>Waiters are FIFO queued.
>>    
>>
>
>Waiters _are_ FIFO queued, but that is not enough to solve this
>starvation problem.  You also need wakeups to immediately pass
>ownership of the mutex to the woken thread.
>
>There is a "fair" mutex variant in Rusty's original futex prototype
>library which has this property.  I'm fairly sure Glibc does not use
>that method, though.
>
>-- Jamie
>  
>