Boost logo

Threads-Devel :

From: Anthony Williams (anthony_at_[hidden])
Date: 2008-04-21 08:23:12


Quoting James Talbut <James.Talbut_at_[hidden]>:

>> > 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?

If the wait() returns, then the user-supplied mutex has to be
reacquired, but if the spurious wake can be detected internally, this
can be avoided, potentially reducing contention on that mutex.
However, if you can't reduce the number to zero, it might be worth
allowing more through in order to force user code to handle it, as you
say.

Anthony

-- 
Anthony Williams            | Just Software Solutions Ltd
Custom Software Development | http://www.justsoftwaresolutions.co.uk
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk