|
Boost Users : |
Subject: Re: [Boost-users] thread running many times
From: Igor R (boost.lists_at_[hidden])
Date: 2011-09-11 16:46:37
> creating thread group
> for(i=0; i < iterations; ++i) {
> Â Â Â Â run threadgroup for parallel part, till all threads finished
> Â Â Â Â run serial part
> }
>
> So I would like to ask for, if the thread group is created, and I call the join_all within the loop, each "join_all" starts the full group again on each iteration or need I create a new threadgroup on each iteration (join_all can be called only once on a group)?
join_all() waits (blocks) until the execution of all the threads in
the group is complete - *that's all*.
In other words: join_all(), like thread::join(), does not start
anything. It just waits until thread completes.
So at the end of every iteration you don't have threads anymore -- if
you need them again, you have to create another ones.
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