Subject: Re: Syscalls to set CPU affinity
To: None <>
From: Joerg Sonnenberger <>
List: tech-kern
Date: 09/10/2007 06:01:56
On Mon, Sep 10, 2007 at 02:06:25AM +0300, Mindaugas R. wrote:
> I would like to discuss the API for setting and getting the affinity for
> processes and threads, and operations with CPU sets. My suggestion would be
> adopting the Solaris API, which looks flexible and good for compatibility:
> int processor_bind(idtype_t idtype, id_t id, processorid_t processorid,
>     processorid_t *obind);
> int pset_bind(psetid_t pset, idtype_t idtype, id_t id, psetid_t *opset);
> int pset_create(psetid_t *newpset);
> int pset_destroy(psetid_t pset);
> int pset_assign(psetid_t pset, processorid_t cpu, psetid_t *opset);

Which of this applies to processes and which to threads? I don't think
external setting of thread affinity is a good idea, that should be the
job of the application that cares.