use many_cpus::SystemHardware;
fn main() {
let threads = SystemHardware::current()
.processors()
.spawn_threads(|processor| {
println!("Spawned thread on processor {}", processor.id());
});
for thread in threads {
thread.join().unwrap();
}
println!("All threads have finished.");
}