Skip to main content

block_on_multi

Function block_on_multi 

Source
pub fn block_on_multi<F>(future: F, num_workers: usize) -> F::Output
where F: Future + Send + 'static, F::Output: Send + 'static,
Expand description

Drive future to completion using num_workers OS threads.

Worker 0 is the main thread (drives root future). Workers 1..N-1 are spawned as background threads. All workers share GlobalQueue and steal tasks.

When num_workers <= 1, falls back to block_on_with_spawn (single-thread).