I have a \"main\" function that performs many small, independent tasks each once per time step. However, after each time step, I must wait for all of the tasks to complete befor
may be you can use boost::barrier as follow:
void thread_proc( boost::barrier& b ) { while( true ) { if( !ioservice.run_one() ) break; // io_service stopped b.wait(); } }