Subj : Re: Futexes are wrong! (Are they?) To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Mon Jun 06 2005 12:56 pm "Jomu" writes: > As consumer-producer message queues are (for me, probably elsewhere > also) most frequent sync devices, and their problem with preemptive > signaling happens mostly (maybe only) when one thread signals while > holding mutex (same one waiting thread will try to reacquire when > signaled) then why don't rearrange signaling so that it happens > after mutex is freed? I guess it will work in this case. Unfortunately in the case I have pthread_cond_{broadcast,signal} is followed by pthread_cond_wait, so I can't move signalling after unlocking and additional context switches are pointless. BTW, is it better to use pthread_cond_broadcast or pthread_cond_signal when I know that only one thread is waiting? -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ .