I've got some crashes that I think are simply due to changes refactoring my code into multiple chunks. How can I run a TBB application where multiple chunks are created but only a single thread is used? This would allow me to reproduce problems in a debugger without having to also debug race conditions.
I apologize for a long response time.
You can control the number of threads the following way:
auto mp = tbb::global_control::max_allowed_parallelism;
tbb::global_control gc(mp, nth + 1); // One more thread, but sleeping