Skip to content

EntropyEngine::Core::Concurrency::AdaptiveRankingScheduler::ThreadState

EntropyEngine::Core::Concurrency::AdaptiveRankingScheduler::ThreadState

Section titled “EntropyEngine::Core::Concurrency::AdaptiveRankingScheduler::ThreadState”

Per-thread state for adaptive scheduling. More…

Name
voidreset()
Name
size_trankingUpdateCounter
Counts work done since last ranking update.
std::vector< WorkContractGroup * >rankedGroups
Thread-local group priority ordering.
uint64_tlastSeenGeneration
Generation counter for detecting group list changes.
size_tcurrentGroupIndex
Current position in rankedGroups (thread affinity position).
size_tconsecutiveExecutionCount
Number of consecutive executions on current group.
struct EntropyEngine::Core::Concurrency::AdaptiveRankingScheduler::ThreadState;

Per-thread state for adaptive scheduling.

This structure enables scheduling by maintaining thread-local copies of rankings and affinity state. The design eliminates locks, atomics, and contention between threads. Synchronization occurs only when the group list changes or during periodic rebalancing operations.

The rankedGroups vector represents each thread’s independent priority ordering. Rankings update based on thread-local observations, which may differ slightly between threads. This variance helps prevent thundering herd effects during work distribution.

inline void reset()
size_t rankingUpdateCounter = 0;

Counts work done since last ranking update.

std::vector< WorkContractGroup * > rankedGroups;

Thread-local group priority ordering.

uint64_t lastSeenGeneration = 0;

Generation counter for detecting group list changes.

size_t currentGroupIndex = 0;

Current position in rankedGroups (thread affinity position).

size_t consecutiveExecutionCount = 0;

Number of consecutive executions on current group.


Updated on 2026-01-26 at 17:14:35 -0500