pub struct SchedulerConfig {
pub steal_threshold: u32,
pub share_threshold: u32,
pub max_steal_batch: u32,
pub steal_neighborhood: u32,
pub enabled: bool,
pub strategy: SchedulingStrategy,
}Expand description
Configuration for dynamic actor scheduling.
Fields§
§steal_threshold: u32Queue depth below which the scheduler tries to steal work.
Queue depth above which the scheduler offers work to neighbors.
max_steal_batch: u32Maximum messages to steal in one operation.
steal_neighborhood: u32Number of neighbor blocks to check for work stealing.
enabled: boolEnable/disable dynamic scheduling (can be toggled at runtime).
strategy: SchedulingStrategyScheduling strategy.
Implementations§
Source§impl SchedulerConfig
impl SchedulerConfig
Sourcepub fn static_scheduling() -> Self
pub fn static_scheduling() -> Self
Create a static (no scheduling) configuration.
This is the current default behavior: each thread block processes its own fixed work queue. No load balancing occurs.
Sourcepub fn work_stealing(steal_threshold: u32) -> Self
pub fn work_stealing(steal_threshold: u32) -> Self
Create a work-stealing configuration with the given threshold.
When an actor’s queue depth falls below steal_threshold, its scheduler
warp will attempt to steal messages from the busiest neighbor.
Sourcepub fn round_robin() -> Self
pub fn round_robin() -> Self
Create a round-robin configuration.
Messages are distributed from a global work queue to blocks in round-robin order, using a global atomic counter for index assignment.
Sourcepub fn priority(levels: u32) -> Self
pub fn priority(levels: u32) -> Self
Create a priority-based configuration with the given number of levels.
Messages are bucketed into priority sub-queues (0 = lowest, levels-1 = highest). The scheduler warp dequeues from the highest-priority non-empty sub-queue first.
Sourcepub fn with_steal_threshold(self, threshold: u32) -> Self
pub fn with_steal_threshold(self, threshold: u32) -> Self
Set the steal threshold.
Set the share threshold.
Sourcepub fn with_max_steal_batch(self, batch: u32) -> Self
pub fn with_max_steal_batch(self, batch: u32) -> Self
Set the maximum steal batch size.
Sourcepub fn with_steal_neighborhood(self, neighborhood: u32) -> Self
pub fn with_steal_neighborhood(self, neighborhood: u32) -> Self
Set the number of neighbor blocks to check for work stealing.
Sourcepub fn with_enabled(self, enabled: bool) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
Enable or disable the scheduler.
Sourcepub fn is_dynamic(&self) -> bool
pub fn is_dynamic(&self) -> bool
Check if this configuration uses dynamic scheduling (anything other than Static).
Trait Implementations§
Source§impl Clone for SchedulerConfig
impl Clone for SchedulerConfig
Source§fn clone(&self) -> SchedulerConfig
fn clone(&self) -> SchedulerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more