Expand description
CPU-related operational helpers (affinity probing/pinning). CPU-related operational helpers.
Platform support
- Linux: uses
sched_getaffinity/sched_setaffinity. - Other OSes: functions return an error.
Contracts
- Pinning affects the current thread only.
- CPU ids are OS CPU indices as used by the kernel.
Functionsยง
- current_
thread_ allowed_ cpus - Returns the list of CPUs the current thread is allowed to run on (Linux).
- fmt_
cpu_ list - Format a list of CPU ids as a comma-separated string.
- pin_
current_ thread_ to_ cpu - Pins the current thread to the given CPU (Linux).