Re: Thread starvation with mutex

Ingo Molnar <[email protected]> Tue, 10 Feb 2004 20:54:02 +0100
Newsgroups gmane.comp.lib.phil
Message-ID <[email protected]>
* Jamie Lokier <[email protected]> wrote:

> > 4. Thread 1 attempts to acquire mutex again but the wait queue isn't 
> > empty, is added to the wait queue and the thread sleeps

>     - At step 4 NPTL decides to acquire the mutex; it doesn't check
>       for other pending waiters because only the kernel knows about them
>       and NPTL does not enter the kernel if avoidable.

NPTL should have info about pending waiters - the first 30 bits of the
__lock field are a rough estimation. So if there are pending waiters
NPTL could do a wakeup of them - this could be a new, nondefault mutex
mode.

	Ingo