Expand description
CPU affinity utilities for Linux systems.
This crate provides safe Rust bindings for setting CPU affinity and querying the current task affinity mask. Useful for performance-critical applications that need precise control over thread placement.
§Examples
use agave_cpu_utils::*;
let allowed = cpu_affinity(None)?;
if let Some(&cpu) = allowed.first() {
set_cpu_affinity(None, [cpu])?;
}Structs§
- CpuId
- Identifies a logical CPU (hardware thread) by its kernel-assigned ID.
Functions§
- cpu_
affinity - Get the CPU affinity mask for a thread.
- set_
cpu_ affinity - Set CPU affinity for a thread.