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
613867a2
Commit
613867a2
authored
12 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
queue_gettask no longer needs to know what the qid is.
Former-commit-id: e3b091df016a5439da38e5e8ec3eee8587531e43
parent
cfa54797
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/queue.c
+1
-1
1 addition, 1 deletion
src/queue.c
src/queue.h
+1
-1
1 addition, 1 deletion
src/queue.h
src/scheduler.c
+2
-2
2 additions, 2 deletions
src/scheduler.c
with
4 additions
and
4 deletions
src/queue.c
+
1
−
1
View file @
613867a2
...
@@ -130,7 +130,7 @@ void queue_init ( struct queue *q , struct task *tasks ) {
...
@@ -130,7 +130,7 @@ void queue_init ( struct queue *q , struct task *tasks ) {
* @param keep Remove the returned task from this queue.
* @param keep Remove the returned task from this queue.
*/
*/
struct
task
*
queue_gettask
(
struct
queue
*
q
,
int
qid
,
struct
cell
*
super
,
int
blocking
)
{
struct
task
*
queue_gettask
(
struct
queue
*
q
,
struct
cell
*
super
,
int
blocking
)
{
int
k
,
temp
,
qcount
,
*
qtid
,
gotcha
;
int
k
,
temp
,
qcount
,
*
qtid
,
gotcha
;
lock_type
*
qlock
=
&
q
->
lock
;
lock_type
*
qlock
=
&
q
->
lock
;
...
...
This diff is collapsed.
Click to expand it.
src/queue.h
+
1
−
1
View file @
613867a2
...
@@ -51,6 +51,6 @@ struct queue {
...
@@ -51,6 +51,6 @@ struct queue {
/* Function prototypes. */
/* Function prototypes. */
struct
task
*
queue_gettask
(
struct
queue
*
q
,
int
qid
,
struct
cell
*
super
,
int
blocking
);
struct
task
*
queue_gettask
(
struct
queue
*
q
,
struct
cell
*
super
,
int
blocking
);
void
queue_init
(
struct
queue
*
q
,
struct
task
*
tasks
);
void
queue_init
(
struct
queue
*
q
,
struct
task
*
tasks
);
void
queue_insert
(
struct
queue
*
q
,
struct
task
*
t
);
void
queue_insert
(
struct
queue
*
q
,
struct
task
*
t
);
This diff is collapsed.
Click to expand it.
src/scheduler.c
+
2
−
2
View file @
613867a2
...
@@ -850,7 +850,7 @@ struct task *scheduler_gettask ( struct scheduler *s , int qid , struct cell *su
...
@@ -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
++
)
{
for
(
int
tries
=
0
;
res
==
NULL
&&
s
->
waiting
&&
tries
<
scheduler_maxtries
;
tries
++
)
{
/* Try to get a task from the suggested queue. */
/* Try to get a task from the suggested queue. */
if
(
s
->
queues
[
qid
].
count
>
0
&&
(
res
=
queue_gettask
(
&
s
->
queues
[
qid
]
,
qid
,
super
,
1
)
)
!=
NULL
)
if
(
s
->
queues
[
qid
].
count
>
0
&&
(
res
=
queue_gettask
(
&
s
->
queues
[
qid
]
,
super
,
1
)
)
!=
NULL
)
break
;
break
;
/* If unsucessful, try stealing from the other queues. */
/* If unsucessful, try stealing from the other queues. */
...
@@ -861,7 +861,7 @@ struct task *scheduler_gettask ( struct scheduler *s , int qid , struct cell *su
...
@@ -861,7 +861,7 @@ struct task *scheduler_gettask ( struct scheduler *s , int qid , struct cell *su
qids
[
count
++
]
=
k
;
qids
[
count
++
]
=
k
;
for
(
k
=
0
;
k
<
scheduler_maxsteal
&&
count
>
0
;
k
++
)
{
for
(
k
=
0
;
k
<
scheduler_maxsteal
&&
count
>
0
;
k
++
)
{
int
ind
=
rand
()
%
count
;
int
ind
=
rand
()
%
count
;
if
(
(
res
=
queue_gettask
(
&
s
->
queues
[
qids
[
ind
]
]
,
qid
,
super
,
0
)
)
!=
NULL
)
if
(
(
res
=
queue_gettask
(
&
s
->
queues
[
qids
[
ind
]
]
,
super
,
0
)
)
!=
NULL
)
break
;
break
;
else
else
qids
[
ind
]
=
qids
[
--
count
];
qids
[
ind
]
=
qids
[
--
count
];
...
...
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