Function aoc::util::thread::spawn_batches

source ยท
pub fn spawn_batches<F, T, U>(items: Vec<U>, f: F)
where F: FnOnce(Vec<U>) -> T + Copy + Send, T: Send, U: Send,
Expand description

Splits items into batches, one per thread. Items are assigned in a round robin fashion, to achieve a crude load balacing in case some items are more complex to process than others.