Skip to main content

Module threadpool

Module threadpool 

Source
Expand description

Runnable threadpool with priority lanes (RT-CORBA §5.7) — the runtime realization of the structural model from crate::policy.

A ThreadpoolRuntime maps each Lane onto real OS threads: per lane, static_threads workers are created at startup and up to dynamic_threads more are added dynamically under saturation (with idle-timeout teardown). dispatch routes a job via Threadpool::lane_for into the lane of its priority. All workers wait event-driven on a condvar (no busy-poll).

The OS scheduler priority (e.g. pthread_setschedparam/SCHED_FIFO) is set via the injectable NativePrioritySetter hook — the platform-specific, possibly unsafe code needed there deliberately lives in the caller, so that this crate stays forbid(unsafe_code).

Structs§

ThreadpoolRuntimestd
A running threadpool with priority lanes (RT-CORBA §5.7).

Enums§

DispatchErrorstd
Error from dispatch.

Traits§

NativePrioritySetterstd
Hook for setting the native OS scheduler priority of a worker thread.