- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
![](/skins/images/7B0AB6865064EAE32B30EC9A4E94B48A/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page