Community
cancel
Showing results for 
Search instead for 
Did you mean: 
jczhang_bj
Beginner
81 Views

Does TBB support blocking tasks?

Hi,
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?
Thanks!
-- Zhang
0 Kudos
2 Replies
RafSchietekat
Black Belt
81 Views

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.
Alexey_K_Intel3
Employee
81 Views

For now, TBB does not support well what you call blocking tasks. We recommend to use dedicatedthreads for things that can block for a while.
Reply