Boost logo

Boost Users :

Subject: Re: [Boost-users] thread running many times
From: Igor R (boost.lists_at_[hidden])
Date: 2011-09-11 16:14:08


> I create a thread group and run the group with join_all(). My code shows
> like:
> for(i=0; i < runs; ++i) {
>      threadgoup.join_all();
>      do something with the results
> }
> So I run the thread group n times. Is this the correct way or can I call join_all only once on the group?

You do not "run the group with join_all".
join_all() waits (blocks) until the execution of all the threads in
the group is complete - that's all.
This is well documented:
http://www.boost.org/doc/libs/1_47_0/doc/html/thread/thread_management.html#thread.thread_management.threadgroup.join_all


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