cvs commit: src/share/man/man9 sleep.9

Kris Kennaway kris at
Tue Feb 27 23:58:44 UTC 2007

On Tue, Feb 27, 2007 at 11:09:32PM +0000, Greg Lehey wrote:

>   - the issues with wakeup_one are due to address space clashes between
>     unrelated groups of threads.

> | -function
> | -does not work reliably if more than one thread is sleeping on the same address;
> | -in this case it is possible for an unrelated thread to be woken.
> | -This thread will ignore the wakeup, and the correct process will never be
> | -woken.
> | +function does not work reliably if unrelated threads are sleeping on the same
> | +address.
> | +In this case, if a wakeup for one group of threads is delivered to a member of
> | +another group, that thread will ignore the wakeup, and the correct thread will
> | +never be woken up.
> | +It is the programmer's responsibility to choose a unique
> | +.Fa chan
> | +value.
> | +In case of doubt, do not use
> | +.Fn wakeup_one .

I don't like this recommendation, since it directs the programmer to
introduce potentially serious performance bottlenecks at the expense
of clear thinking about their code to avoid introducing the bug in the
first place.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the cvs-src mailing list