Skip to content

Instantly share code, notes, and snippets.

@adkri
Created September 21, 2022 22:57
Show Gist options
  • Select an option

  • Save adkri/c4695ac0cefd3d99d346433c79b2f889 to your computer and use it in GitHub Desktop.

Select an option

Save adkri/c4695ac0cefd3d99d346433c79b2f889 to your computer and use it in GitHub Desktop.
let pool = rayon::ThreadPoolBuilder::new()
.num_threads(256)
.build()
.unwrap();
pool.install(|| {
let run_result: Vec<ResultingThing> = my_things
.into_par_iter()
.map(crate::do_something)
.collect();
for thing in run_result {
println!("{:?}: ", thing);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment