I'm new to TBB.I have tasks that may be blocking (for example, reading data from a remote machine, that is very slow) ornon-blocking (only doing local computations, that is fast). At runtime, I can know whether a task is blocking or non-blocking.
I want to have a scheduler that can swap out blocking tasks, and continue with other non-blocking tasks. Once requirements for a blocking task are met, the scheduler can resume the task.
Does TBB support that?
If not, which part of TBB should I look at to add this functionality?
To avoid undersubscription, do not let tasks block for a significant amount of time.
Try to work around this yourself for now, perhaps by making the blocking condition a dependency that is decremented when a dedicated thread serving the outstanding request determines that it has been serviced.