Boost logo

Threads-Devel :

From: James Talbut (James.Talbut_at_[hidden])
Date: 2008-04-21 04:22:14


> > One question about the spurious-wake-prevention: Is the absence of
> > spurious wakes one of the guarantees made by the threading library
> > proposal?
> No. In general, spurious wakes cannot be prevented. However,
> I would like to minimize them as much as possible.

Is it worth it?

As I see it:
1. The thread calling wait is going to wake up - you can't stop it.
2. You can't prevent the user from having to write code to handle some
spurious wakes because it's impossible to remove them all.
3. Anything you write to reduce the number of spurious wakes is thus an
optimisation - and premature, given that the user can implement
something more efficient themselves.
4. If spurious wakes are frequent it is more likely that client code
will handle them correctly - my task for today is to put spurious wake
handling code into some else' code :)


This e-mail, and any attachment, is confidential. If you have received it in error, do not use or disclose the information in any way, notify me immediately, and please delete it from your system.

Threads-Devel list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at