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

Re: Thread starvation with mutex



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






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