chronon::sender::TerminationController
#include <TerminationRequest.hpp>
Public Functions
| Name | |
|---|---|
| ~TerminationController() =default | |
| void | setStopSource(stdexec::inplace_stop_source * src) |
| void | setSettledTime(SimTime time) |
| void | setOrderedClocks(bool enabled) |
| void | reset() Not thread-safe — call only when simulation is stopped. |
| bool | requestTermination(TerminationReason reason, int32_t exit_code =0, uint64_t cycle =0, std::string_view unit_name ="", std::string_view message ="", ClockDomainId clock_domain_id =0, std::optional< SimTime > physical_time =std::nullopt, uint64_t canonical_order =UINT64_MAX) |
| TerminationController & | operator=(const TerminationController & ) =delete |
| TerminationController & | operator=(TerminationController && ) =delete |
| bool | isTerminationRequested() const |
| const TerminationRequest & | getRequest() const |
| TerminationController() =default | |
| TerminationController(const TerminationController & ) =delete | |
| TerminationController(TerminationController && ) =delete |
Detailed Description
class chronon::sender::TerminationController;
Thread-safe controller for simulation termination.
Hot-path check is a single relaxed atomic load (~1-2ns), called once per epoch (~64 cycles). Request submission is mutex-protected and first-wins by default. Explicit parallel clock graphs opt into physical-time ordering so requests discovered while settling do not depend on host arrival order.
Public Functions Documentation
function ~TerminationController
~TerminationController() =default
function setStopSource
inline void setStopSource(
stdexec::inplace_stop_source * src
)
Wire to an external stop_source for unified stop propagation. When set, requestTermination() also calls stop_source->request_stop().
function setSettledTime
inline void setSettledTime(
SimTime time
)
Scheduler-only: call after clock workers have joined or a serial batch has finished. Does not change the original request timestamp.
function setOrderedClocks
inline void setOrderedClocks(
bool enabled
)
Configure before workers start. Clock requests choose the earliest physical instant, domain ID, then canonical unit order.
function reset
inline void reset()
Not thread-safe — call only when simulation is stopped.
function requestTermination
inline bool requestTermination(
TerminationReason reason,
int32_t exit_code =0,
uint64_t cycle =0,
std::string_view unit_name ="",
std::string_view message ="",
ClockDomainId clock_domain_id =0,
std::optional< SimTime > physical_time =std::nullopt,
uint64_t canonical_order =UINT64_MAX
)
Return: true if accepted (including replacement by an earlier clock request).
Request simulation termination. Thread-safe; first request wins unless ordered clock requests were enabled before starting the workers.
function operator=
TerminationController & operator=(
const TerminationController &
) =delete
function operator=
TerminationController & operator=(
TerminationController &&
) =delete
function isTerminationRequested
inline bool isTerminationRequested() const
function getRequest
inline const TerminationRequest & getRequest() const
For ordered clocks, read only after the workers have joined: earlier requests discovered while settling can replace the initial request.
function TerminationController
TerminationController() =default
function TerminationController
TerminationController(
const TerminationController &
) =delete
function TerminationController
TerminationController(
TerminationController &&
) =delete
Updated on 2026-09-20 at 14:23:39 +0000