Skip to main content

set_affinity

Function set_affinity 

Source
pub fn set_affinity<I>(ids: I)
where I: Iterator<Item = usize> + Clone + Debug,
Expand description

Sets the core affinity for this thread.

The IDs should be listed in CORES_AVAILABLE; empty input is a no-op that leaves the prior affinity unchanged. The mask is always recorded for get_affinity, but the thread is pinned only in builds with the cpu_affinity feature.