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
19cfb535
Commit
19cfb535
authored
Oct 04, 2012
by
Pedro Gonnet
Browse files
use re-entrant random number generator.
Former-commit-id: 48f6a62012fbc2705cc16d6d7a896c21f9880036
parent
bb4462a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/runner.c
View file @
19cfb535
...
...
@@ -1239,6 +1239,7 @@ void *runner_main ( void *data ) {
struct
queue
*
queues
[
r
->
nr_queues
],
*
myq
;
struct
task
*
t
;
struct
cell
*
ci
,
*
cj
;
unsigned
int
myseed
=
rand
()
+
rt
->
id
;
#ifdef TIMER
ticks
stalled
;
#endif
...
...
@@ -1288,7 +1289,7 @@ void *runner_main ( void *data ) {
if
(
(
myq
->
next
==
myq
->
count
)
||
(
t
=
queue_gettask
(
myq
,
0
,
0
)
)
==
NULL
)
{
TIMER_TIC2
qid
=
rand
(
)
%
naq
;
qid
=
rand
_r
(
&
myseed
)
%
naq
;
keep
=
(
r
->
policy
&
runner_policy_keep
)
&&
(
myq
->
count
<=
myq
->
size
-
tpq
);
if
(
myq
->
next
==
myq
->
count
)
...
...
@@ -1312,7 +1313,7 @@ void *runner_main ( void *data ) {
}
}
else
if
(
r
->
policy
&
runner_policy_rand
)
{
qid
=
rand
(
)
%
naq
;
qid
=
rand
_r
(
&
myseed
)
%
naq
;
t
=
queue_gettask
(
queues
[
qid
]
,
r
->
policy
&
runner_policy_block
,
0
);
}
else
{
...
...
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