Thread pool crate to execute a certain number of jobs on a fixed set of worker threads.
When connecting thread pool is filled with a certain number of workers, which is specified in the constructor. In the context of each worker, certain job is done. Job is a closure that is passed to the execute thread pool. Workers communicate with each other through channels
extern crate multithread;
use multithread::ThreadPool;
fn main () {
let pool = ThreadPool::new(4).unwrap();
pool.execute(|| {
// some closure body ...
});
}