Commit e144a899 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

simplify queue re-ordering since we won't really be re-using the queues.


Former-commit-id: bb1560db37c0081233cf337c4254e1ac7cda4596
parent 577e7fb9
......@@ -385,9 +385,13 @@ struct task *queue_gettask ( struct queue *q , int rid , int blocking , int keep
if ( keep ) {
/* Bubble-up. */
q->count = qcount - 1;
/* q->count = qcount - 1;
for ( k = ind_best ; k < qcount - 1 ; k++ )
qtid[k] = qtid[k+1];
qtid[k] = qtid[k+1]; */
/* Swap with last task. */
q->count = qcount - 1;
qtid[ ind_best ] = qtid[ q->count ];
}
......@@ -397,9 +401,15 @@ struct task *queue_gettask ( struct queue *q , int rid , int blocking , int keep
TIMER_TIC2
/* Bubble-down the task. */
for ( k = ind_best ; k > q->next ; k-- )
/* for ( k = ind_best ; k > q->next ; k-- )
qtid[ k ] = qtid[ k-1 ];
qtid[ q->next ] = tid;
qtid[ q->next ] = tid; */
/* Swap with the first task. */
if ( ind_best != q->next ) {
qtid[ ind_best ] = qtid[ q->next ];
qtid[ q->next ] = tid;
}
/* up the counter. */
q->next += 1;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment