Crates.io | free-cpus |
lib.rs | free-cpus |
version | 2.0.0 |
source | src |
created_at | 2023-10-23 13:28:34.292509 |
updated_at | 2023-10-23 15:44:36.178787 |
description | Get the set of free CPU cores on your Linux machine. |
homepage | https://github.com/louismerlin/free-cpus |
repository | https://github.com/louismerlin/free-cpus |
max_upload_size | |
id | 1011326 |
size | 16,684 |
Get the set of free CPU cores on your Linux machine.
The logic is heavily inspired by AFL++'s code.
Add to Cargo.toml:
[dependencies]
free-cpus = "2.0.0"
In your rust code:
// Get the set of free CPU cores on this Linux machine
let cpus: HashMap<usize> = free_cpus::get().unwrap();