Enhanced policies for selecting work-stealing victims.
Core threading foundation of the thread system library.
steal_backoff_strategy
Backoff strategies for work-stealing operations.
@ exponential
Exponential increase: delay = initial * 2^attempt.
enhanced_steal_policy
Enhanced policies for selecting work-stealing victims.
@ hierarchical
NUMA node first, then random within node (large NUMA systems)
@ locality_aware
Prefer workers with recent cooperation history (cache affinity)
@ adaptive
Select based on queue sizes (best for uneven loads)
@ numa_aware
Prefer workers on the same NUMA node (reduces cross-node traffic)
Backoff strategies for work-stealing operations.
Configuration for enhanced work-stealing with NUMA awareness.
std::chrono::microseconds max_backoff
Maximum backoff delay cap (default: 1000 microseconds)
static auto hierarchical_numa() -> enhanced_work_stealing_config
Create a configuration for hierarchical NUMA systems.
std::size_t max_steal_batch
Maximum number of jobs to steal in a batch (default: 4)
bool track_locality
Enable work affinity tracking between workers (default: disabled)
std::size_t max_steal_attempts
Maximum number of steal attempts per round (default: 3)
steal_backoff_strategy backoff_strategy
Backoff strategy between failed steal attempts (default: exponential)
static auto batch_optimized() -> enhanced_work_stealing_config
Create a configuration for aggressive batch stealing.
std::size_t min_steal_batch
Minimum number of jobs to steal in a batch (default: 1)
bool collect_statistics
Enable statistics collection (default: disabled)
static auto default_config() -> enhanced_work_stealing_config
Create a default configuration (disabled)
std::chrono::microseconds initial_backoff
Initial backoff delay (default: 50 microseconds)
bool numa_aware
Enable NUMA-aware stealing (default: disabled)
static auto numa_optimized() -> enhanced_work_stealing_config
Create a configuration optimized for NUMA systems.
double backoff_multiplier
Backoff multiplier for exponential strategy (default: 2.0)
static auto locality_optimized() -> enhanced_work_stealing_config
Create a configuration optimized for cache locality.
bool enabled
Master switch for work-stealing (default: disabled)
std::size_t max_consecutive_failures
Maximum consecutive failures before yielding (default: 10)
std::size_t locality_history_size
Size of cooperation history for locality tracking (default: 16)
enhanced_steal_policy policy
Policy for selecting steal victims (default: adaptive)
double numa_penalty_factor
Cost multiplier for cross-NUMA node steals (default: 2.0) Higher values make cross-node steals less l...
bool adaptive_batch_size
Dynamically adjust batch size based on victim's queue depth (default: true)
bool prefer_same_node
Prefer workers on the same NUMA node (default: true)