
Michael Glassford <glassfordm <at> hotmail.com> writes:
Actually, to get enough threads to reenter barrier while some
still inside, you need fresh threads on the next barrier. IOW,
How does it know when to release all the threads? Do you mean that you would "register" ahead of time which threads are supposed to wait, and it releases them all when they have all waited on the barrier? What would happen if an "unregistered" thread tried to wait on the barrier? Mike "Matthew Vogt" <mvogt@juptech.com> wrote in message news:loom.20040219T005359-652@post.gmane.org... threads are threads A, B
and C wait on barrier. A gets through and spawns B' and C'. Then A, B' and C' wait on barrier, get though, and leave B and C stuck on condition wait forever.
True, I realize that. Or you could simply create a barrier that blocks until it reaches, say, 5 threads and then send 10 threads through it. In a worst case scenario, 4 of the first 5 threads to wait on the barrier could get stuck there permanently.
Is it possible to create a barrier that waits for a set of threads before permitting them to continue, rather than a count of threads? Perhaps a thread_group is a safer layer at which to implement a barrier...
Matt
(Adding extra lines at the end to make gmane let this through...)
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost