Boost logo

Boost Users :

From: Michael Glassford (glassfordm_at_[hidden])
Date: 2004-02-16 20:33:47


"Craig Rodrigues" <rodrigc_at_[hidden]> wrote in message
news:20040216221856.GA61960_at_crodrigues.org...
> 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_at_[hidden]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net