Boost logo

Boost :

Subject: Re: [boost] boost condition_variable internals
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2014-01-25 04:58:43


On Friday 24 January 2014 08:46:23 Kenneth Adam Miller wrote:
> I need to know that boost does not use any kind of locking, mutex or
> semaphore mechanism within the boost::condition_variable class. I don't
> know where it is in source, or I would check to make certain. Can someone
> provide me a yes no verification?

The condition variable is part of Boost.Thread. Depending on the platform,
it's implemented in boost/thread/win32/condition_variable.hpp or
boost/thread/pthread/condition_variable_fwd.hpp.

Since condition variable has to block the calling thread, it necessarily has
to contain some basic synchronization primitive. In case of Windows it's a
semaphore, on POSIX it's a pthread condition variable, which uses a mutex
internally to my knowledge.


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