I need twos features that I'm currently unable to find in TBB:
- a way to reduce (at runtime, and during a task execution) the number of threads used.
- a way to pause the execution of my tasks (or allocate 0 threads to the current task)
The idea behind that is that the user of my tool must be allowed to pause the execution if he wants to free its processor for another task. Or he may decide to only allocate 4 of its 8 cores to this task.
Because my task can take a while to end, I need to be able to do this change "in the middle of a task".
I'm currently using task_scheduler_init between the creation of task, but because it waits for the end of task to take effect, the effect can take too long.
Is there a way to do this inside TBB?