Skip to content
Snippets Groups Projects
Commit 706900a4 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

change stealing policy, small fix.

Former-commit-id: ea5b93c50035310c1c8a44c7df2b50db8edf1691
parent 23768ccc
Branches
Tags
No related merge requests found
...@@ -758,10 +758,8 @@ struct task *scheduler_gettask ( struct scheduler *s , int qid ) { ...@@ -758,10 +758,8 @@ struct task *scheduler_gettask ( struct scheduler *s , int qid ) {
for ( k = 0 ; k < nr_queues ; k++ ) for ( k = 0 ; k < nr_queues ; k++ )
if ( s->queues[k].count > 0 ) if ( s->queues[k].count > 0 )
qids[ count++ ] = k; qids[ count++ ] = k;
if ( count > 1 ) { if ( count > 0 && ( res = queue_gettask( &s->queues[ qids[ rand() % count ] ] , qid , 0 ) ) != NULL )
if ( ( res = queue_gettask( &s->queues[ qids[ rand() % count ] ] , qid , 0 ) ) != NULL ) break;
break;
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment