Subj : Re: Real cause of spurius wakeups To : comp.programming.threads From : Vladimir Prus Date : Fri Apr 01 2005 11:50 am Alexander Terekhov wrote: > Vladimir Prus wrote: >> >> Hello, >> >> can somebody explain the real reason why spurious wakeups are possible. >> That is, why call to pthread_cond_wait can return without >> pthread_cond_broadcast/pthread_cond_signal. > > Because apart from realtime scheduling, > pthread_cond_broadcast/pthread_cond_signal can be implemented as nop. > > No kidding. Yes, I understand. But I doubt there's any real implementation that does this way. I'm mostly interested in a practical reasons. > See also > > http://terekhov.de/DESIGN-futex-CV.cpp > http://terekhov.de/DESIGN-futex-CV-with-async.cancelable-wait.txt And how spurious wakeups are possible in that implementation? Unfortunately I can't immediately see that from 10K of code. - Volodya .