ID EN
OS

sched_setaffinity

Python 3.11

Restrict the process with PID pid (or the current process if zero) to a set of CPUs. mask is an iterable of integers representing the set of CPUs to which the process should be restricted.

Syntax

PYTHON
os.sched_setaffinity(pid, mask, /)