Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
f36bddec
Commit
f36bddec
authored
12 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
time only the queue lock.
Former-commit-id: 62e5b572c185f871689ee5cc94c42ad4f70ab6e0
parent
f0522d5d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/queue.c
+3
-5
3 additions, 5 deletions
src/queue.c
src/timers.h
+1
-1
1 addition, 1 deletion
src/timers.h
with
4 additions
and
6 deletions
src/queue.c
+
3
−
5
View file @
f36bddec
...
@@ -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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/timers.h
+
1
−
1
View file @
f36bddec
...
@@ -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_q
ueue
,
timer_q
lock
,
timer_stalled
,
timer_stalled
,
timer_runners
,
timer_runners
,
timer_step
,
timer_step
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment