Information on TBB Scheduler and Task Stealing

Dmitriy Vyukov
Total Points:
25,462
Status Points:
25,462
Black Belt
November 8, 2008 2:12 AM PST
Rate
 
#1
Quoting - abhishek84

I think that void GenericScheduler::spawn( task& first, task*& next ) sees the insertion of a task in the relevant queue. Therefore, I have inserted a counter increment at:

if( arena_slot==&dummy_slot ) {
try_enter_arena();
__TBB_ASSERT( arena_slot->steal_end&1, NULL );
} else {
acquire_task_pool(); GATHER_STATISTIC(acquire_task++);
}

TaskPool* tp = dummy_slot.task_pool;
next = tp->array[d]; 
tp->array[d] = &first;

#ifdef(MY_COUNTER)
counter++
#endif

You don't take into account that spawn() can enqueue a bunch of tasks, not only single task. You must use something like:

#ifdef(MY_COUNTER)
counter += number_of_spawned_tasks;
#endif




Intel Software Network Forums Statistics

8474 users have contributed to 31606 threads and 100656 posts to date.
In the past 24 hours, we have 30 new thread(s) 109 new posts(s), and 163 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 Dear Steve, excuse me for a d

Please welcome our newest member Kevin Johnson