Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
474b2e4b
Commit
474b2e4b
authored
Sep 29, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Sep 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Use kernel support for thread affinity when available.
parent
24036fe1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
0 deletions
+27
-0
configure
configure
+1
-0
configure.ac
configure.ac
+1
-0
config.h.in
include/config.h.in
+3
-0
thread.c
server/thread.c
+22
-0
No files found.
configure
View file @
474b2e4b
...
...
@@ -12127,6 +12127,7 @@ for ac_func in \
pwrite
\
readdir
\
readlink
\
sched_setaffinity
\
sched_yield
\
select
\
setproctitle
\
...
...
configure.ac
View file @
474b2e4b
...
...
@@ -1692,6 +1692,7 @@ AC_CHECK_FUNCS(\
pwrite \
readdir \
readlink \
sched_setaffinity \
sched_yield \
select \
setproctitle \
...
...
include/config.h.in
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
...
...
server/thread.c
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
...
...
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