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

Re: Thread starvation with mutex



* Jamie Lokier <jamie shareable org> 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




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