tess 1.0.0
Performance-first tile and path simulation substrate
Loading...
Searching...
No Matches
tess::experimental::maintenance::DirtyBitScheduler Class Referencefinal

#include <tess/experimental/maintenance.h>

Inheritance diagram for tess::experimental::maintenance::DirtyBitScheduler:
tess::experimental::maintenance::MaintenanceScheduler

Public Member Functions

 DirtyBitScheduler (std::size_t capacity)
auto register_task (MaintenanceTask &task) -> bool
void seal ()
auto schedule (MaintenanceTask &task) -> bool override
auto run_some (MaintenanceBudget budget) -> bool override
auto flush () -> bool override
 Completes all reachable work; see the non-reentrant drain contract above.
auto metrics () const noexcept -> MaintenanceMetrics override
auto has_pending () const noexcept -> bool override

Detailed Description

Coalescing scheduler backed by registered task bits.

Register every task during setup, before scheduling or draining begins. Registration is idempotent for the same task and bounded by the constructor capacity. Call seal() after registration; it publishes the immutable registry to concurrent producers. Tasks remain non-owning and must outlive this scheduler or a completed flush(). Registration order defines deterministic drain order. Destroying the scheduler drops pending work without executing it. A thread's first successful post-seal schedule() or first task execution may initialize platform thread-local runtime state; later scheduling on that thread is allocation-free.

Member Function Documentation

◆ flush()

auto tess::experimental::maintenance::DirtyBitScheduler::flush ( ) -> bool
inlinenodiscardoverridevirtual

Completes all reachable work; see the non-reentrant drain contract above.

Implements tess::experimental::maintenance::MaintenanceScheduler.

◆ has_pending()

auto tess::experimental::maintenance::DirtyBitScheduler::has_pending ( ) const -> bool
inlinenodiscardoverridevirtualnoexcept

Returns whether this backend currently retains reachable work.

Implements tess::experimental::maintenance::MaintenanceScheduler.

◆ metrics()

auto tess::experimental::maintenance::DirtyBitScheduler::metrics ( ) const -> MaintenanceMetrics
inlinenodiscardoverridevirtualnoexcept

◆ register_task()

auto tess::experimental::maintenance::DirtyBitScheduler::register_task ( MaintenanceTask & task) -> bool
inlinenodiscard

Registers one task during setup; false reports exhausted capacity.

◆ run_some()

auto tess::experimental::maintenance::DirtyBitScheduler::run_some ( MaintenanceBudget budget) -> bool
inlinenodiscardoverridevirtual

Runs reachable work until the queue or supplied budget is exhausted.

Do not call this or flush() from MaintenanceTask::run(): queued backends serialize drains with a non-recursive lock. schedule() is the only reentrant scheduler operation supported from a running task.

Implements tess::experimental::maintenance::MaintenanceScheduler.

◆ schedule()

auto tess::experimental::maintenance::DirtyBitScheduler::schedule ( MaintenanceTask & task) -> bool
inlinenodiscardoverridevirtual

Schedules derived-state work.

The task must outlive this scheduler or an explicit flush(). A false result reports bounded capacity exhaustion, incomplete backend setup, an unknown task identity, or a backend that cannot make progress; authoritative state must retain its dirty signal so a caller can retry.

Implements tess::experimental::maintenance::MaintenanceScheduler.

◆ seal()

void tess::experimental::maintenance::DirtyBitScheduler::seal ( )
inline

Publishes the completed registry and ends the setup phase.


The documentation for this class was generated from the following file: