I hereby claim:
- I am kkonevets on github.
- I am kkonevets (https://keybase.io/kkonevets) on keybase.
- I have a public key ASBDwhEUid3Y8x8VN7AqS-CuaY_TF0XXddWhC5SUbXx2sAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
use std::error::Error; | |
use std::sync::mpsc; | |
use std::sync::Arc; | |
use std::thread; | |
const NTHREADS: usize = 4; | |
/// Apply function `f` to vector `v` in parallelm keeping the order. | |
/// If `v` length is less than `threshold` no splitting will occur and no threads be created | |
fn apply_par<F, T, R>(v: Vec<T>, f: F, threshold: usize) -> Result<Vec<R>, Box<dyn Error>> |