Boost logo

Boost :

From: Michael Glassford (glassfordm_at_[hidden])
Date: 2004-02-18 19:46:51


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_at_[hidden]> wrote in message
news:loom.20040219T005359-652_at_post.gmane.org...
> Michael Glassford <glassfordm <at> hotmail.com> writes:
>
> > > Actually, to get enough threads to reenter barrier while some
threads are
> > > still inside, you need fresh threads on the next barrier. IOW,
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
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk