server(1/3): Use kernel support for process affinity when available
Alexandre Julliard
julliard at winehq.org
Fri Jan 23 07:00:05 CST 2009
Juan Lang <juan.lang at gmail.com> writes:
> +static void get_process_affinity( struct process *process )
> +{
> + affinity_t affinity = ~0;
> +
> +#ifdef HAVE_SCHED_H
> + if (process->unix_pid != -1)
> + {
> + cpu_set_t set;
> +
> + CPU_ZERO( &set );
> + if (!sched_getaffinity( process->unix_pid, sizeof(set), &set ))
You should add a configure check for sched_getaffinity, having sched.h
is not enough.
> @@ -403,6 +432,7 @@ data_size_t init_process( struct thread *thread )
> struct process *process = thread->process;
> struct startup_info *info = process->startup_info;
>
> + get_process_affinity( process );
You should retrieve it as needed. Most apps don't have any need for that
information so we don't want to incur the cost of fetching it for every
started process.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list