Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Available cores

The first thing we should to before trying to use multiple cores is to know how many cores (CPUs) we have.

fn main() {
    println!("{}", std::thread::available_parallelism().unwrap());
}