
1 Sep
2008
1 Sep
'08
6:18 p.m.
On Mon, Sep 1, 2008 at 8:00 PM, Stjepan Rajko <stipe@asu.edu> wrote:
On Mon, Sep 1, 2008 at 10:50 AM, Giovanni Piero Deretta <gpderetta@gmail.com> wrote:
Spurious wakeups are rare in practice. OTOH, what is more likely to happen is that the main thread could miss the wake-up if the worker thread managed to signal the condition variable before the main thread got to wait for it (remember that condition variables are stateless).
Wouldn't the mutex lock have taken care of that? asio_server blocks before notifying, and the main thread doesn't release the mutex until getting to the wait point.
Yes, you a right. It can fail only because of a spurious wakeup. -- gpd