Subject: Re: [boost] [thread] Request review of new synchronisation object, boost::permit<>
From: Peter Dimov (lists_at_[hidden])
Date: 2014-05-05 16:13:01
Niall Douglas wrote:
> Spurious wakeups absolutely can be prevented by the implementation,
> just for backwards compatibility POSIX cannot do so.
No, the POSIX committee knew that they can be prevented, too.
What I am saying is that they could have disallowed them when they wrote the
specification, but did not, on purpose. Code that has problems with spurious
wakeups also has problems with other corner cases (such as the one from my
other post); and writing it to handle spurious wakeups takes care of these
other corner cases as well.
You are not the first to assume that spurious wakeups represent a deficiency
in the POSIX specification and that it would have been better without them,
but this is not true, at least in principle. (Pragmatically speaking,
without spurious wakeups, incorrect code fails less often, sometimes "never"
for practical purposes. But... well.)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk