pub trait WorkStealingTask: Send + 'static {
type Output: Send;
// Required method
fn execute(&mut self) -> Self::Output;
// Provided methods
fn estimated_cost(&self) -> f64 { ... }
fn can_subdivide(&self) -> bool { ... }
fn subdivide(&self) -> Vec<Box<dyn WorkStealingTask<Output = Self::Output>>>
where Self: Sized { ... }
}Expand description
Generic task that can be executed by the work-stealing scheduler
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn estimated_cost(&self) -> f64
fn estimated_cost(&self) -> f64
Estimate computational cost (for load balancing)
Sourcefn can_subdivide(&self) -> bool
fn can_subdivide(&self) -> bool
Check if task can be subdivided for better load balancing