执行者 具有Rust高性能任务执行器的库。 用法 将此添加到您的Cargo.toml : [ dependencies ] executors = " 0.9 " 您可以使用,例如, 安排一些n_jobs在多个n_workers线程,并通过收集结果mpsc::channel 。 use executors :: * ; use executors :: crossbeam_workstealing_pool; use std :: sync :: mpsc :: channel; let n_workers = 4 ; let n_jobs = 8 ; let pool = crossbeam_workstealing_pool :: small_pool (n_workers); let (tx, rx) = channel (); for _ in 0 ..n_jobs {