Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tsn-measures
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
tsn-measures
Commits
5c96fd63
Commit
5c96fd63
authored
May 01, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CPU affinity issue
parent
c7d63de1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
clock-res/src/clockres.c
clock-res/src/clockres.c
+6
-6
No files found.
clock-res/src/clockres.c
View file @
5c96fd63
...
@@ -53,17 +53,17 @@ static void *timerthread(void *p) {
...
@@ -53,17 +53,17 @@ static void *timerthread(void *p) {
thread_param_t
*
param
=
(
thread_param_t
*
)
p
;
thread_param_t
*
param
=
(
thread_param_t
*
)
p
;
thread_stat_t
*
stat
=
&
param
->
stat
;
thread_stat_t
*
stat
=
&
param
->
stat
;
// Set thread priority
priority
.
sched_priority
=
param
->
priority
;
if
(
sched_setscheduler
(
0
,
SCHED_FIFO
,
&
priority
))
error
(
EXIT_FAILURE
,
errno
,
"Couldn't set priority"
);
// Set thread CPU affinity
// Set thread CPU affinity
CPU_ZERO
(
&
mask
);
CPU_ZERO
(
&
mask
);
CPU_SET
(
1
,
&
mask
);
CPU_SET
(
1
,
&
mask
);
if
(
pthread_setaffinity_np
(
0
,
sizeof
(
mask
),
&
mask
)
==
-
1
)
if
(
sched_setaffinity
(
0
,
sizeof
(
mask
),
&
mask
)
)
printf
(
"Could not set CPU affinity to CPU #1
\n
"
);
printf
(
"Could not set CPU affinity to CPU #1
\n
"
);
// Set thread priority
priority
.
sched_priority
=
param
->
priority
;
if
(
sched_setscheduler
(
0
,
SCHED_FIFO
,
&
priority
))
error
(
EXIT_FAILURE
,
errno
,
"Couldn't set priority"
);
stat
->
max_res
=
0
;
stat
->
max_res
=
0
;
stat
->
min_res
=
UINT64_MAX
;
stat
->
min_res
=
UINT64_MAX
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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