[lkml]   [2006]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: NPTL mutex and the scheduling priority
On Thu, Sep 07, 2006 at 05:11:58PM +0900, Atsushi Nemoto wrote:
> Three months after, I have tried kernel 2.6.18 with recent glibc. I
> got desired results for pthread_mutex_unlock and
> pthread_cond_broadcast, with PI-mutex.
> But pthread_cond_signal and sem_post still wakeup a thread in FIFO
> order, as you can guess.
> With the plist patch (applied by hand), I can get desired behavior.
> Thank you. But It seems the patch lacks reordering on priority
> changes.

Yes, either something like the plist patch for FUTEX_WAKE etc. or, if that
proves to be too slow for the usual case (non-RT threads), FIFO wakeup
initially and conversion to plist wakeup whenever first waiter with realtime
priority is added, is still needed. That will cure e.g. non-PI
pthread_mutex_unlock and sem_post. For pthread_cond_{signal,broadcast} we
need further kernel changes, so that the condvar's internal lock can be
always a PI lock.

> <off_topic>
> BTW, If I tried to create a PI mutex on a kernel without PI futex
> support, pthread_mutexattr_setprotocol(PTHREAD_PRIO_INHERIT) returned
> 0 and pthread_mutex_init() returned ENOTSUP. This is not a right
> behavior according to the manual ...
> </off_topic>

POSIX doesn't forbid ENOTSUP in pthread_mutex_init to my knowledge.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-09-07 10:35    [W:0.068 / U:4.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site