core-affinity-rs
is a Rust crate for managing CPU affinities. It currently supports Linux, Mac OSX, and Windows.
Example
This example shows how create a thread for each available processor and pin each thread to its corresponding processor.
extern crate core_affinity;
use thread;
// Retrieve the IDs of all active CPU cores.
let core_ids = get_core_ids.unwrap;
// Create a thread for each active CPU core.
let handles = core_ids.into_iter.map.;
for handle in handles.into_iter