
3 Apr
2009
3 Apr
'09
10:27 a.m.
Jean-Sebastien Stoezel wrote:
Thanks for the quick reply. Using conditon variables sounds quite heavy. You need to instantiate a mutex, a condition variable and a flag... Would there be anything wrong with instantiating a semaphore from the interprocess library to provide inter-thread synchronization? You can use a semaphore from the interprocess library to provide inter-thread synchronization. An interprocess semaphore is a thin wrapper around a posix semaphore if BOOST_INTERPROCESS_POSIX_SEMAPHORES is defined. Otherwise, a semaphore is emulated with a mutex and a condvar.
By the way, why isn't there any semaphore available in the thread library?
The boost.Crypto library is going to provide some. BR, Dmitry