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

time only the queue lock.

Former-commit-id: 62e5b572c185f871689ee5cc94c42ad4f70ab6e0
parent f0522d5d
Branches
Tags
No related merge requests found
...@@ -146,20 +146,19 @@ struct task *queue_gettask ( struct queue *q , int qid , int blocking ) { ...@@ -146,20 +146,19 @@ struct task *queue_gettask ( struct queue *q , int qid , int blocking ) {
lock_type *qlock = &q->lock; lock_type *qlock = &q->lock;
struct task *qtasks, *res = NULL; struct task *qtasks, *res = NULL;
struct cell *ci, *cj; struct cell *ci, *cj;
TIMER_TIC
/* If there are no tasks, leave immediately. */ /* If there are no tasks, leave immediately. */
if ( q->count == 0 ) { if ( q->count == 0 )
TIMER_TOC(timer_queue);
return NULL; return NULL;
}
/* Main loop, while there are tasks... */ /* Main loop, while there are tasks... */
while ( q->count > 0 ) { while ( q->count > 0 ) {
/* Grab the task lock. */ /* Grab the task lock. */
TIMER_TIC
if ( lock_lock( qlock ) != 0 ) if ( lock_lock( qlock ) != 0 )
error( "Locking the qlock failed.\n" ); error( "Locking the qlock failed.\n" );
TIMER_TOC( timer_qlock );
/* Set some pointers we will use often. */ /* Set some pointers we will use often. */
qtid = q->tid; qtid = q->tid;
...@@ -264,7 +263,6 @@ struct task *queue_gettask ( struct queue *q , int qid , int blocking ) { ...@@ -264,7 +263,6 @@ struct task *queue_gettask ( struct queue *q , int qid , int blocking ) {
} /* while there are tasks. */ } /* while there are tasks. */
/* Take the money and run. */ /* Take the money and run. */
TIMER_TOC(timer_queue);
return res; return res;
} }
......
...@@ -35,7 +35,7 @@ enum { ...@@ -35,7 +35,7 @@ enum {
timer_dopair_subset, timer_dopair_subset,
timer_doghost, timer_doghost,
timer_gettask, timer_gettask,
timer_queue, timer_qlock,
timer_stalled, timer_stalled,
timer_runners, timer_runners,
timer_step, timer_step,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment