
On Wed, Apr 8, 2009 at 14:30, Jeremy Rottman
The main reason I want to remove the thread is when the daemon iterates, I do not want it to create new threads if threads are currently running. I am currently testing with 25 threads, the total thread count is dynamic. To sum it up, if threads are active and running, I do not want new threads to be created until no threads are active. The issue I am having is trying to determine if there are active threads still running code.
After join_all() has returned, there are no "active threads still running code." This in no way implies a result of 0 from size(). It seems you're doing this: thread_group tg; while (something) { create_some_threads(tg, ...); tg.join_all(); } and are disappointed that !tg.empty() when the loop restarts. Have you considered just doing this? while (something) { thread_group tg; create_some_threads(tg, ...); tg.join_all(); }