11 Sep
2011
11 Sep
'11
8:46 p.m.
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.