"Craig Rodrigues"
Hi,
Would it be a good thing to add semaphore and barrier classes to Boost Threads? For semaphores, having something analogous to the POSIX functions sem_wait() and sem_post() would be nice.
The original designer of the Boost.Thread library and others felt that semaphores were too easily misused, leading to errors (see http://boost.org/libs/thread/doc/rationale.html#events). Others have argued the issue on the various Boost mailing lists at some length more than once; some have been convinced that the "too easily misused" argument has merit, others have not.
For barriers, having something analogous to pthread_barrier_wait() would be nice.
As far as adding a barrier class, however: one has existed in the thread_dev branch in CVS for quite some time; I hope to move it to the main branch very soon. Mike
It is not very hard to roll your own versions of these primitives using boost::condition and boost::mutex classes, but it would be nice to have them in a library.
Any opinions?
Thanks.
-- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org