boost condition_variable internals
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?
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.
participants (2)
-
Andrey Semashev
-
Kenneth Adam Miller