RE: Thread starvation with mutex
"Perez-Gonzalez, Inaky" <[email protected]> Fri, 6 Feb 2004 14:33:41 -0800
| Newsgroups | gmane.comp.lib.phil |
|---|---|
| Message-ID | <[email protected]> |
> From: Jamie Lokier > > 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. I don't think this is an starvation problem; to me it seems more like the code is flawed. POSIX mandates that on unlock(), the scheduling policy dictates who gets the lock, so even if you had scheduling-deterministic (like for example RTNPTL+fusyn) unlocks, it will depend on (as you said before) the dynamic priority. NPTL is not fully POSIX compliant in that aspect, but even if it were, the code would behave unpredictably (except when using SCHED_RR or SCHED_FIFO). Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own (and my fault)