Information on TBB Scheduler and Task Stealing

Dmitriy Vyukov
Total Points:
25,422
Status Points:
25,422
Black Belt
November 9, 2008 3:31 AM PST
Rate
 
#4
Quoting - abhishek84

task* GenericScheduler::steal_task( UnpaddedArenaSlot& arena_slot, depth_type d ) {

...

TaskPool* tp = arena_slot.task_pool;
depth_type i = tp->prefix().steal_begin;
if( i<d )
i = d;
for(; i<=steal_end>>1; ++i ) {

if( result = tp->array[i] ) {

tp->array[i] = result->prefix().next;

#ifdef(MY_COUNTER)
counter--
#endif

...

}

It seems that you are working with not latest release. However be aware that in latest releases there is another issue - mailboxes. Single task can reside in thread's work-stealing deque AND in another thread's mailbox SIMULTANEOUSLY.

get_task() function copes with it internally. But steal_task() doesn't. I.e. steal_task() can return such task, and then the task will be discarded, because it's already consumed through get_task().

If you will be working with latest version you must account for this.

 



Intel Software Network Forums Statistics

8458 users have contributed to 31572 threads and 100537 posts to date.
In the past 24 hours, we have 18 new thread(s) 132 new posts(s), and 152 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Quoting - rase if (k.eq.0

Please welcome our newest member soundmyth