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
Merge requests
!411
Use getticks() to get enough randomness when enqueing tasks without owners.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Use getticks() to get enough randomness when enqueing tasks without owners.
rand_fix2
into
master
Overview
1
Commits
1
Changes
1
Merged
Matthieu Schaller
requested to merge
rand_fix2
into
master
7 years ago
Overview
1
Commits
1
Changes
-
Expand
How about this version ?
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
8e964073
1 commit,
7 years ago
+
2
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/scheduler.c
+
2
−
3
Options
@@ -1381,9 +1381,8 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
if
(
qid
>=
s
->
nr_queues
)
error
(
"Bad computed qid."
);
/* If no previous owner, pick a random queue. */
if
(
qid
<
0
)
qid
=
rand_r
((
unsigned
int
*
)
pthread_getspecific
(
s
->
local_seed_pointer
))
%
s
->
nr_queues
;
/* Note that getticks() is random enough */
if
(
qid
<
0
)
qid
=
getticks
()
%
s
->
nr_queues
;
/* Increase the waiting counter. */
atomic_inc
(
&
s
->
waiting
);
Loading