
16 Sep
2011
16 Sep
'11
4:50 a.m.
I'm new to threads and boost, so I'm sure this is a real newbie question and hopefully quite easy to answer! I'm trying to set up a pool of threads that do a calculation, and I want to wait for those calculations to finish. Normally I'd do thread_group.join_all() to wait for the threads to exit - but in this case I want my threads hanging around so that I can redo that calculation over and over again when I ask it to do. What's the best way to signal back to the main thread that all calculations are complete? Should I use a barrier?