pub fn sched_setaffinity(pid: Option<Pid>, cpuset: &CpuSet) -> Result<()>
sched_setaffinity(pid, cpuset)—Set a thread’s CPU affinity mask.
sched_setaffinity(pid, cpuset)
pid is the thread ID to update. If pid is None, then the current thread is updated.
pid
None
The CpuSet argument specifies the set of CPUs on which the thread will be eligible to run.
CpuSet