
Gottlob Frege wrote:
If boost threads doesn't have a semaphore, we could add one.
boost::thread doesn't have a semaphore for a purpose. boost::threads is modelled after the pthreads API, which does not need what you are seeking for. Perhaps you could look up a book on pthreads for an in depth explanation? For short in pthreads API the state and the notification are decoupled, which is a more general aproach. Of course you know it, but it is straight forward to get the equivalent of a semaphore with boost::threads. Something like (details omitted): mutex mx; int count = 42; codition c; ... //acquire { lock(mx); while (0==count) c.wait(mx); --count; } ... //release { lock(mx); ++count; c.notify_all(); } Regards, Roland -- _________________________________________ _ _ | Roland Schwarz aka. speedsnail |_)(_ | sip:speedsnail@ekiga.net | \__) | mailto:roland.schwarz@chello.at ________| http://www.blackspace.at