Boost logo

Boost :

Subject: Re: [boost] [threads] wait() and signal() ?
From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2009-10-07 10:51:07


On 10/7/09, David M. Cotter <me_at_[hidden]> wrote:
>>> how can i do this with boost::thread ?
>>
>> A condition variable doesn't have state. If you call wait, you
>> will always block until another thread calls notify_one or notify_all.
>> notify_one and notify_all have no effect if no threads are waiting.
>
>
> well that completely explains it :)
>
> thanks. i've added that state to my class and now it's working great.
> thanks again!

If boost threads doesn't have a semaphore, we could add one.
Is the mac one a counting semaphore? Or just a single, like windows 'events'?
We could add both actually. The manual reset, preset/passthru, etc
properties come in handy at times.
They can of course be implemented by the client on top of what is
already there, but if it is common and useful, it could be part of the
lib. A library level impl could also make better use of OS level
support.

Tony


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk