Information on TBB Scheduler and Task Stealing

Dmitriy Vyukov
Total Points:
24,747
Status Points:
24,747
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

8292 users have contributed to 31239 threads and 99117 posts to date.
In the past 24 hours, we have 10 new thread(s) 11 new posts(s), and 19 new user(s).

In the past 3 days, the most popular thread for everyone has been huge pages on linux? The most posts were made to Pipeline buffer between stages? The post with the most views is Very amusing...  Escalated as

Please welcome our newest member amirsam7