many_cpus 2.4.0

Efficiently schedule work and inspect the hardware environment on many-processor systems
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! We inspect every processor available to the current process and write a
//! human-readable description of it to the terminal.
//!
//! This obeys the operating system enforced processor selection constraints
//! assigned to the current process (which is always the case).
//!
//! However, this does not obey the resource quota available to the current process. This is
//! typically not useful for executing work but may be useful for inspecting available processors.

use many_cpus::SystemHardware;

fn main() {
    for processor in SystemHardware::current().all_processors() {
        println!("{processor:?}");
    }
}