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.

Revisions

  1. adkri revised this gist Sep 21, 2022. No changes.
  2. adkri revised this gist Sep 21, 2022. No changes.
  3. adkri created this gist Sep 21, 2022.
    16 changes: 16 additions & 0 deletions main.rs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    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);
    }
    });