pub fn pin_thread(cores: &[usize])Expand description
Pin the calling thread to the given set of logical CPUs.
ยงPlatform behaviour
| OS | Semantics |
|---|---|
| Linux | Sets the CPU affinity mask to the union of the given cores |
via sched_setaffinity. Pass multiple cores to restrict the | |
| thread to a cluster (e.g. all P-cores). | |
| macOS | Uses the first core as an opaque affinity tag; threads with |
| the same tag are co-scheduled by the Mach scheduler. Extra | |
| cores are ignored (macOS has no multi-core mask). | |
| Other | No-op. |
An empty slice is a no-op on all platforms.