Set the CPU affinity of the process identified by pid to mask. mask should be an iterable of integers identifying CPUs.
os/sched_setaffinity
sched_setaffinity