TBB with fixed number of threads for one task, and default for others
问题 I want to execute a for-loop in parallel (using TBB) over a set of blocks, where each block will be processed using a user-supplied function. Normally, I would do this using tbb::parallel_for() . For various reasons, I want to be able to limit the number of threads processing the blocks to a prescribed number, call it j . Normally, I would do this using tbb::task_scheduler_init(j) . However, I would like the user to have the option to use TBB and, specifically, let the user-supplied function