![]() |
Contur 2
Educational OS kernel simulator
|
Host-thread worker pool runtime for dispatcher lanes. More...
#include <dispatcher_pool.h>
Public Member Functions | |
| DispatcherPool (HostThreadingConfig config={}) | |
| Constructs a worker pool runtime. | |
| ~DispatcherPool () override | |
| Destroys pool runtime and joins worker threads. | |
| DispatcherPool (const DispatcherPool &)=delete | |
| Copy construction is disabled. | |
| DispatcherPool & | operator= (const DispatcherPool &)=delete |
| Copy assignment is disabled. | |
| DispatcherPool (DispatcherPool &&) noexcept | |
| Move-constructs pool runtime state. | |
| DispatcherPool & | operator= (DispatcherPool &&) noexcept |
| Move-assigns pool runtime state. | |
| std::string_view | name () const noexcept override |
| Returns runtime implementation name. | |
| const HostThreadingConfig & | config () const noexcept override |
| Returns runtime-owned normalized threading config. | |
| Result< void > | dispatch (const DispatcherLanes &lanes, std::size_t tickBudget) override |
| Runs one pooled dispatch pass across all lanes. | |
| void | tick (const DispatcherLanes &lanes) override |
| Ticks lanes using pooled workers. | |
| std::uint64_t | lastEpoch () const noexcept |
| Last completed runtime epoch identifier. | |
| std::vector< std::size_t > | lastDeterministicOrder () const |
| Stable lane order used by deterministic dispatch mode. | |
| std::vector< TraceEvent > | lastTraceEvents () const |
| Runtime trace metadata emitted by the last dispatch/tick pass. | |
| Public Member Functions inherited from contur::IDispatchRuntime | |
| virtual | ~IDispatchRuntime ()=default |
Private Attributes | |
| std::unique_ptr< Impl > | impl_ |
Host-thread worker pool runtime for dispatcher lanes.
DispatcherPool owns worker threads and executes lane dispatch/tick jobs using runtime-owned HostThreadingConfig. Deterministic mode uses stable static lane partitioning; non-deterministic mode can use dynamic work stealing when enabled.
Work stealing operates at two independent, non-conflicting levels:
The two levels are orthogonal: runtime stealing moves whole lanes between threads, scheduler stealing moves processes between ready queues. Enabling one does not affect the other.
Definition at line 38 of file dispatcher_pool.h.
|
explicit |
Constructs a worker pool runtime.
| config | Runtime threading config owned and normalized by the runtime. |
References config().
Referenced by DispatcherPool(), DispatcherPool(), operator=(), and operator=().
|
override |
Destroys pool runtime and joins worker threads.
|
delete |
Copy construction is disabled.
References DispatcherPool().
|
noexcept |
Move-constructs pool runtime state.
References DispatcherPool().
|
nodiscardoverridevirtualnoexcept |
Returns runtime-owned normalized threading config.
Implements contur::IDispatchRuntime.
References config().
Referenced by config(), and DispatcherPool().
|
nodiscardoverridevirtual |
Runs one pooled dispatch pass across all lanes.
Implements contur::IDispatchRuntime.
References dispatch().
Referenced by dispatch().
|
nodiscard |
Stable lane order used by deterministic dispatch mode.
References lastDeterministicOrder().
Referenced by lastDeterministicOrder().
|
nodiscardnoexcept |
|
nodiscard |
Runtime trace metadata emitted by the last dispatch/tick pass.
References lastTraceEvents().
Referenced by lastTraceEvents().
|
nodiscardoverridevirtualnoexcept |
Returns runtime implementation name.
Implements contur::IDispatchRuntime.
References name().
Referenced by name().
|
delete |
Copy assignment is disabled.
References DispatcherPool().
|
noexcept |
Move-assigns pool runtime state.
References DispatcherPool().
|
overridevirtual |
Ticks lanes using pooled workers.
Implements contur::IDispatchRuntime.
References tick().
Referenced by tick().
|
private |
Definition at line 82 of file dispatcher_pool.h.