simple_parallel 0.3.0

Straight-forward functions and types for basic data parallel operations, including parallel maps, for loops and thread pools.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extern crate simple_parallel;
extern crate crossbeam;

fn main() {
    let mut pool = simple_parallel::Pool::new(4);

    crossbeam::scope(|scope| {
        for _ in pool.map(scope, 0..100, |i| {
            println!("{}", i);
            if i == 10 {
                panic!("innermost");
            }
        }) {}
    });
}