pub struct ParallelConfig {
pub num_workers: usize,
pub steal_strategy: StealStrategy,
pub numa_strategy: NumaStrategy,
pub enable_priority: bool,
pub enable_stats: bool,
pub max_queue_size: usize,
pub cache_line_padding: bool,
}Expand description
Parallel execution configuration.
Fields§
§num_workers: usizeNumber of worker threads
steal_strategy: StealStrategyWork-stealing strategy
numa_strategy: NumaStrategyNUMA allocation strategy
enable_priority: boolEnable task priority
enable_stats: boolEnable load balancing statistics
max_queue_size: usizeMaximum queue size per worker
cache_line_padding: boolEnable cache-line padding for worker queues
Implementations§
Source§impl ParallelConfig
impl ParallelConfig
Sourcepub fn new(num_workers: usize) -> Result<Self, ParallelError>
pub fn new(num_workers: usize) -> Result<Self, ParallelError>
Create a new parallel config.
Sourcepub fn with_num_workers(self, num_workers: usize) -> Self
pub fn with_num_workers(self, num_workers: usize) -> Self
Set the number of workers.
Sourcepub fn with_steal_strategy(self, strategy: StealStrategy) -> Self
pub fn with_steal_strategy(self, strategy: StealStrategy) -> Self
Set the steal strategy.
Sourcepub fn with_numa_strategy(self, strategy: NumaStrategy) -> Self
pub fn with_numa_strategy(self, strategy: NumaStrategy) -> Self
Set the NUMA strategy.
Sourcepub fn with_priority(self, enabled: bool) -> Self
pub fn with_priority(self, enabled: bool) -> Self
Enable or disable priority.
Sourcepub fn with_stats(self, enabled: bool) -> Self
pub fn with_stats(self, enabled: bool) -> Self
Enable or disable statistics.
Trait Implementations§
Source§impl Clone for ParallelConfig
impl Clone for ParallelConfig
Source§fn clone(&self) -> ParallelConfig
fn clone(&self) -> ParallelConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParallelConfig
impl Debug for ParallelConfig
Source§impl Default for ParallelConfig
impl Default for ParallelConfig
Source§impl<'de> Deserialize<'de> for ParallelConfig
impl<'de> Deserialize<'de> for ParallelConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ParallelConfig
impl PartialEq for ParallelConfig
Source§impl Serialize for ParallelConfig
impl Serialize for ParallelConfig
impl StructuralPartialEq for ParallelConfig
Auto Trait Implementations§
impl Freeze for ParallelConfig
impl RefUnwindSafe for ParallelConfig
impl Send for ParallelConfig
impl Sync for ParallelConfig
impl Unpin for ParallelConfig
impl UnwindSafe for ParallelConfig
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