Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Alexey Alyaev
wine
Commits
474b2e4b
Commit
474b2e4b
authored
15 years ago
by
Juan Lang
Committed by
Alexandre Julliard
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
server: Use kernel support for thread affinity when available.
parent
24036fe1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure
+1
-0
1 addition, 0 deletions
configure
configure.ac
+1
-0
1 addition, 0 deletions
configure.ac
include/config.h.in
+3
-0
3 additions, 0 deletions
include/config.h.in
server/thread.c
+22
-0
22 additions, 0 deletions
server/thread.c
with
27 additions
and
0 deletions
configure
+
1
−
0
View file @
474b2e4b
...
...
@@ -12127,6 +12127,7 @@ for ac_func in \
pwrite \
readdir \
readlink \
sched_setaffinity \
sched_yield \
select \
setproctitle \
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
1
−
0
View file @
474b2e4b
...
...
@@ -1692,6 +1692,7 @@ AC_CHECK_FUNCS(\
pwrite \
readdir \
readlink \
sched_setaffinity \
sched_yield \
select \
setproctitle \
...
...
This diff is collapsed.
Click to expand it.
include/config.h.in
+
3
−
0
View file @
474b2e4b
...
...
@@ -645,6 +645,9 @@
/* Define to 1 if you have the <sched.h> header file. */
#undef HAVE_SCHED_H
/* Define to 1 if you have the `sched_setaffinity' function. */
#undef HAVE_SCHED_SETAFFINITY
/* Define to 1 if you have the `sched_yield' function. */
#undef HAVE_SCHED_YIELD
...
...
This diff is collapsed.
Click to expand it.
server/thread.c
+
22
−
0
View file @
474b2e4b
...
...
@@ -35,6 +35,9 @@
#ifdef HAVE_POLL_H
#include
<poll.h>
#endif
#ifdef HAVE_SCHED_H
#include
<sched.h>
#endif
#include
"ntstatus.h"
#define WIN32_NO_STATUS
...
...
@@ -406,7 +409,26 @@ struct thread *get_thread_from_pid( int pid )
void
set_thread_affinity
(
struct
thread
*
thread
,
affinity_t
affinity
)
{
#ifdef HAVE_SCHED_SETAFFINITY
if
(
thread
->
unix_pid
!=
-
1
)
{
cpu_set_t
set
;
int
i
;
affinity_t
mask
;
CPU_ZERO
(
&
set
);
for
(
i
=
0
,
mask
=
1
;
mask
;
i
++
,
mask
<<=
1
)
if
(
affinity
&
mask
)
CPU_SET
(
i
,
&
set
);
if
(
!
sched_setaffinity
(
thread
->
unix_pid
,
sizeof
(
set
),
&
set
))
thread
->
affinity
=
affinity
;
else
file_set_error
();
}
else
set_error
(
STATUS_ACCESS_DENIED
);
#else
thread
->
affinity
=
affinity
;
#endif
}
#define THREAD_PRIORITY_REALTIME_HIGHEST 6
...
...
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