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
cfa54797
Commit
cfa54797
authored
11 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
re-define queue blocking param.
Former-commit-id: 3d8bc9a2652a01e3587a4d2439758dd758774ff8
parent
7d80a4c5
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
+9
-3
9 additions, 3 deletions
src/queue.c
src/scheduler.c
+1
-1
1 addition, 1 deletion
src/scheduler.c
with
10 additions
and
4 deletions
src/queue.c
+
9
−
3
View file @
cfa54797
...
...
@@ -144,8 +144,14 @@ struct task *queue_gettask ( struct queue *q , int qid , struct cell *super , in
while
(
q
->
count
>
0
)
{
/* Grab the task lock. */
if
(
lock_lock
(
qlock
)
!=
0
)
error
(
"Locking the qlock failed.
\n
"
);
if
(
blocking
)
{
if
(
lock_lock
(
qlock
)
!=
0
)
error
(
"Locking the qlock failed.
\n
"
);
}
else
{
if
(
lock_trylock
(
qlock
)
!=
0
)
return
NULL
;
}
/* Set some pointers we will use often. */
qtid
=
q
->
tid
;
...
...
@@ -221,7 +227,7 @@ struct task *queue_gettask ( struct queue *q , int qid , struct cell *super , in
error
(
"Unlocking the qlock failed.
\n
"
);
/* Leave? */
if
(
res
!=
NULL
||
!
blocking
)
if
(
res
!=
NULL
)
break
;
}
/* while there are tasks. */
...
...
This diff is collapsed.
Click to expand it.
src/scheduler.c
+
1
−
1
View file @
cfa54797
...
...
@@ -850,7 +850,7 @@ struct task *scheduler_gettask ( struct scheduler *s , int qid , struct cell *su
for
(
int
tries
=
0
;
res
==
NULL
&&
s
->
waiting
&&
tries
<
scheduler_maxtries
;
tries
++
)
{
/* Try to get a task from the suggested queue. */
if
(
(
res
=
queue_gettask
(
&
s
->
queues
[
qid
]
,
qid
,
super
,
0
)
)
!=
NULL
)
if
(
s
->
queues
[
qid
].
count
>
0
&&
(
res
=
queue_gettask
(
&
s
->
queues
[
qid
]
,
qid
,
super
,
1
)
)
!=
NULL
)
break
;
/* If unsucessful, try stealing from the other queues. */
...
...
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