pub struct WorkStealingScheduler { /* private fields */ }Expand description
Work-stealing scheduler.
Implementations§
Source§impl WorkStealingScheduler
impl WorkStealingScheduler
Sourcepub fn new(config: ParallelConfig) -> Self
pub fn new(config: ParallelConfig) -> Self
Create a new work-stealing scheduler.
Sourcepub fn submit_batch(&self, tasks: Vec<Task>) -> Result<(), ParallelError>
pub fn submit_batch(&self, tasks: Vec<Task>) -> Result<(), ParallelError>
Submit multiple tasks.
Sourcepub fn execute_all(&self) -> Result<Vec<TaskId>, ParallelError>
pub fn execute_all(&self) -> Result<Vec<TaskId>, ParallelError>
Execute all submitted tasks.
Sourcepub fn stats(&self) -> SchedulerStats
pub fn stats(&self) -> SchedulerStats
Get scheduler statistics.
Sourcepub fn try_steal(&self, thief_idx: usize) -> Option<Task>
pub fn try_steal(&self, thief_idx: usize) -> Option<Task>
Attempt to steal work from another worker.
Sourcepub fn load_balance_stats(&self) -> LoadBalanceStats
pub fn load_balance_stats(&self) -> LoadBalanceStats
Get load balancing statistics.
Auto Trait Implementations§
impl Freeze for WorkStealingScheduler
impl RefUnwindSafe for WorkStealingScheduler
impl Send for WorkStealingScheduler
impl Sync for WorkStealingScheduler
impl Unpin for WorkStealingScheduler
impl UnwindSafe for WorkStealingScheduler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more