Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
e144a899
Commit
e144a899
authored
Mar 27, 2013
by
Pedro Gonnet
Browse files
simplify queue re-ordering since we won't really be re-using the queues.
Former-commit-id: bb1560db37c0081233cf337c4254e1ac7cda4596
parent
577e7fb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/queue.c
View file @
e144a899
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment