Subj : Re: Real cause of spurius wakeups To : comp.programming.threads From : Alexander Terekhov Date : Fri Apr 01 2005 10:40 am Vladimir Prus wrote: [...] > > 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. See .txt above. cond_broadcast() in cond_wait_cleanup_handler2() and "FUTEX WAKE (cv->futex, ALL)" in cond_wait_cleanup() will cause spurious wakeups (same effect due to futex token changes and races with respect to futex wait and futex wake aside for a moment). regards, alexander. .