Jobsteal
A work-stealing fork-join threadpool written in Rust.
Examples
This is a basic example to show a simple way to use the job pool.
use make_pool;
Here's a more useful example where we split up a vector into chunks and submit a job for every part. This makes use of the scoping feature.
use make_pool;
The spawner passed to the "scope" closure can be used to create more scopes -- as nested as you'd like.
This crate has the unfortunate limitation (for the time being) that only 4096 jobs can be spawned on each thread until synchronized. Having this limitation allows jobs to be allocated in contiguous memory, but the benefits of that may not outweigh the costs.
Panic Safety
A panic in one worker is intended to propagate to the main thread eventually. However, the code hasn't been vetted for safety, so please try to avoid panicking in your jobs. There should probably be a PanicSafe bound on job functions.