Skip to main content

Crate agave_cpu_utils

Crate agave_cpu_utils 

Source
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.