Information on TBB Scheduler and Task Stealing

Dmitriy Vyukov
Total Points:
24,747
Status Points:
24,747
Black Belt
November 9, 2008 4:46 AM PST
Rate
 
#5
Quoting - abhishek84
I am trying to get some information on the details of the TBB scheduler code in task.cpp. I basically want to profile how well the random task scheduler performs by tracking each instance of a false negative -- that is, one thread tries to steal a task from another randomly selected task queue, and fails to do so despite the fact that other task queues in fact do have tasks available.

I am curious what do you mean by "how well the random task scheduler performs"? What sources of false-negatives are you looking for?

I see only 2 possible sources of false-negatives:

(1) thread is unable to steal too "low-level" tasks, i.e.:

task* GenericScheduler::steal_task( UnpaddedArenaSlot& arena_slot, depth_type d ) {
task* result = NULL;
ExponentialBackoff backoff;
bool sync_prepare_done = false;
depth_type steal_end = arena_slot.steal_end;
for(;;) {
if( steal_end>>1<d ) {
// Nothing of interest to steal
if( sync_prepare_done )
ITT_NOTIFY(sync_cancel, &arena_slot);
goto done;
}


(2) thread fails to "strip the proxy" after task stealing:

t = steal_task( *victim, d );
if( !t ) goto fail;
if( is_proxy(*t) ) {
t = strip_proxy((task_proxy*)t);
if( !t ) goto fail;
GATHER_STATISTIC( ++proxy_steal_count );
}

If you are trying to track these sources of false-negatives, then probably it's easier to insert statistics collection directly into the places marked with bold.

 



Intel Software Network Forums Statistics

8290 users have contributed to 31237 threads and 99111 posts to date.
In the past 24 hours, we have 8 new thread(s) 18 new posts(s), and 24 new user(s).

In the past 3 days, the most popular thread for everyone has been comparison cilk++, openmp, pthreads first results The most posts were made to comparison cilk++, openmp, pthreads first results The post with the most views is Very amusing...  Escalated as

Please welcome our newest member zq.x