- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I was wondering how this could be done:
We have different parts of the software that have different priorities. For instance lets imagine we have a user thread and a low-level processing thread. Each of them may call parallel algorithms (sort, for, for_each, pipelines, ...) We would like to have user-level threads have more priority when executing parallel tasks.
What I was thinking is something like that: set a priority on a "master" thread and dependant sub-tasks gets priority queued accordingly within tbb. Therefore, worker threads would pop items from the task queue in order or priority.
Or maybe it is the other way around and it is masters that asks for tasks to perform and dispatch.. Therefore, a master with a higher priority would have more chances to get CPU time and therefore send job to workers threads more often..
Mike
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mike,
there is a blog about tbb task priorities. I guess this is what are you asking about
--Vladimir
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
TBB is not configured for multiple threadpriorities, although there is some limited control for task priority.
You can have non-TBB threads incorporated into your program that run at different priority levels. But be careful as to which domain your code is running in. Cross domain calls my yield unexpected results.
Jim Dempsey
You can have non-TBB threads incorporated into your program that run at different priority levels. But be careful as to which domain your code is running in. Cross domain calls my yield unexpected results.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mike,
there is a blog about tbb task priorities. I guess this is what are you asking about
--Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looks like what I needed.. thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FYI, parallel_sort does not have prototypes with task_group_context parameter..
(I'm using 4.0U2, 278oss)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting mlemay@coveo.com
FYI, parallel_sort does not have prototypes with task_group_context parameter..
(I'm using 4.0U2, 278oss)
Initially, task_group_context parameter was used to cancel some algorithm from outside, and we thought that there is no practical sense to cancel sort, which would result in the array being modified (in place)but still unsorted.
However, now with the context extended to also specify priority, adding a corresponding overload to parallel_sort certainly is desirable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the latest commercial release still does not includetask_group_contextparameters to set priority in the parallel_sort ..
Is it still planned?

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