pub struct ExecutorConfig {
pub worker_threads: usize,
pub async_threads: usize,
pub max_global_queue_size: usize,
pub local_queue_initial_capacity: usize,
pub thread_name_prefix: String,
pub worker_placement: WorkerPlacement,
pub enable_metrics: bool,
pub preemption: PreemptionConfig,
pub memory: MemoryConfig,
pub cleanup: CleanupConfig,
}Expand description
Configuration settings for executor behavior and performance characteristics.
This struct encapsulates all tunable parameters that affect executor operation, including thread pool sizes, queue capacities, and various performance optimizations.
Fields§
§worker_threads: usizeNumber of worker threads for parallel tasks
async_threads: usizeNumber of threads dedicated to async tasks
max_global_queue_size: usizeMaximum aggregate size of the workers’ external admission queues.
Executor construction partitions this bound across workers without exceeding it. The value must supply at least two slots per worker.
local_queue_initial_capacity: usizeInitial slot count for each resizable per-worker local priority queue.
Values below the deque minimum normalize upward. Local queues grow when
full; Self::max_global_queue_size is the external admission bound.
thread_name_prefix: StringThread name prefix for worker threads
worker_placement: WorkerPlacementWhether each worker is confined to one logical processor.
WorkerPlacement::Pinned can fail executor construction; see
ExecutorError::WorkerPlacementFailed.
enable_metrics: boolWhether to enable metrics collection
preemption: PreemptionConfigTask preemption configuration
memory: MemoryConfigMemory management configuration
cleanup: CleanupConfigTask cleanup configuration