pub fn sched_setaffinity(pid: Option<Pid>, cpuset: &CpuSet) -> Result<()>
Available on crate feature process only.
Expand description

sched_setaffinity(pid, cpuset)—Set a thread’s CPU affinity mask.

pid is the thread ID to update. If pid is None, then the current thread is updated.

The CpuSet argument specifies the set of CPUs on which the thread will be eligible to run.

References