Lumiera
0.pre.03
»edit your freedom«
|
#include "vault/gear/scheduler-commutator.hpp"
Scheduler Layer-2 : execution of Scheduler Activities.
Definition at line 118 of file scheduler-commutator.hpp.
Public Member Functions | |
bool | acquireGoomingToken () noexcept |
acquire the right to perform internal state transitions. More... | |
template<class DISPATCH , class CLOCK > | |
activity::Proc | dispatchCapacity (SchedulerInvocation &, LoadController &, DISPATCH, CLOCK) |
Implementation of the worker-Functor: More... | |
void | dropGroomingToken () noexcept |
relinquish the right for internal state transitions. More... | |
ActivationEvent | findWork (SchedulerInvocation &layer1, Time now) |
Look into the queues and possibly retrieve work due by now. More... | |
bool | holdsGroomingToken (ThreadID id) noexcept |
check if the indicated thread currently holds the right to conduct internal state transitions. | |
void | maybeFeed (SchedulerInvocation &layer1) |
tend to the input queue if possible | |
activity::Proc | postChain (ActivationEvent event, SchedulerInvocation &layer1) |
This is the primary entrance point to the Scheduler. More... | |
ScopedGroomingGuard | requireGroomingTokenHere () |
a scope guard to force acquisition of the GroomingToken More... | |
Classes | |
class | ScopedGroomingGuard |
struct | WorkerInstruction |
monad-like step sequence: perform sequence of steps, as long as the result remains activity::PASS More... | |
Private Types | |
using | ThreadID = std::thread::id |
Private Member Functions | |
void | ensureDroppedGroomingToken () |
activity::Proc | scatteredDelay (Time now, Time head, LoadController &loadController, LoadController::Capacity capacity) |
A worker asking for work constitutes free capacity, which can be redirected into a focused zone of the scheduler time axis where it is most likely to be useful, unless there is active work to be carried out right away. More... | |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
Private Attributes | |
atomic< ThreadID > | groomingToken_ {} |
|
inlinenoexcept |
acquire the right to perform internal state transitions.
true
if this attempt succeeded Definition at line 137 of file scheduler-commutator.hpp.
References vault::gear::anonymous_namespace{scheduler-commutator.hpp}::thisThread().
Referenced by SchedulerCommutator_test::___ensureGroomingTokenReleased(), SchedulerCommutator_test::blockGroomingToken(), SchedulerCommutator::findWork(), SchedulerCommutator::maybeFeed(), SchedulerCommutator::scatteredDelay(), SchedulerCommutator_test::torture_GroomingToken(), SchedulerCommutator_test::verify_GroomingGuard(), SchedulerCommutator_test::verify_GroomingToken(), and SchedulerCommutator_test::verify_postChain().
|
inlinenoexcept |
relinquish the right for internal state transitions.
Definition at line 153 of file scheduler-commutator.hpp.
References vault::gear::anonymous_namespace{scheduler-commutator.hpp}::thisThread().
Referenced by SchedulerCommutator_test::___ensureGroomingTokenReleased(), SchedulerCommutator_test::blockGroomingToken(), SchedulerCommutator_test::integratedWorkCycle(), SchedulerCommutator::postChain(), SchedulerCommutator::ScopedGroomingGuard::ScopedGroomingGuard(), SchedulerCommutator_test::torture_GroomingToken(), SchedulerCommutator_test::verify_GroomingGuard(), SchedulerCommutator_test::verify_GroomingToken(), SchedulerCommutator_test::verify_postChain(), and Scheduler::ExecutionCtx::work().
|
inline |
a scope guard to force acquisition of the GroomingToken
Definition at line 458 of file scheduler-commutator.hpp.
Referenced by Scheduler::handleDutyCycle(), SchedulerCommutator::holdsGroomingToken(), Scheduler::seedCalcStream(), and SchedulerCommutator_test::verify_GroomingGuard().
|
inline |
Look into the queues and possibly retrieve work due by now.
Definition at line 193 of file scheduler-commutator.hpp.
References SchedulerCommutator::acquireGoomingToken(), SchedulerInvocation::feedPrioritisation(), SchedulerCommutator::holdsGroomingToken(), SchedulerInvocation::isDue(), SchedulerInvocation::isOutdated(), SchedulerInvocation::isOutOfTime(), SchedulerInvocation::pullHead(), and vault::gear::anonymous_namespace{scheduler-commutator.hpp}::thisThread().
Referenced by SchedulerCommutator_test::demonstrateSimpleUsage(), SchedulerCommutator::dispatchCapacity(), SchedulerCommutator_test::integratedWorkCycle(), SchedulerCommutator_test::verify_findWork(), SchedulerCommutator_test::verify_postChain(), and SchedulerCommutator_test::verify_Significance().
|
inline |
This is the primary entrance point to the Scheduler.
Place the given event into the schedule, with prioritisation according to its start time.
event | the chain of Render Activities to be scheduled, including start time and deadline |
Definition at line 227 of file scheduler-commutator.hpp.
References SchedulerCommutator::dispatchCapacity(), SchedulerCommutator::dropGroomingToken(), SchedulerInvocation::feedPrioritisation(), SchedulerCommutator::holdsGroomingToken(), SchedulerInvocation::instruct(), SchedulerCommutator::scatteredDelay(), and vault::gear::anonymous_namespace{scheduler-commutator.hpp}::thisThread().
Referenced by Scheduler::handleDutyCycle(), SchedulerCommutator_test::integratedWorkCycle(), Scheduler::ExecutionCtx::post(), Scheduler::postChain(), and SchedulerCommutator_test::verify_postChain().
|
inline |
Implementation of the worker-Functor:
Definition at line 314 of file scheduler-commutator.hpp.
References SchedulerCommutator::findWork(), SchedulerInvocation::headTime(), LoadController::markIncomingCapacity(), LoadController::markOutgoingCapacity(), SchedulerCommutator::maybeFeed(), and SchedulerCommutator::scatteredDelay().
Referenced by Scheduler::doWork(), SchedulerCommutator::postChain(), and SchedulerCommutator_test::verify_dispatch().
|
inlineprivate |
A worker asking for work constitutes free capacity, which can be redirected into a focused zone of the scheduler time axis where it is most likely to be useful, unless there is active work to be carried out right away.
capacity | classification of the capacity to employ this thread |
Definition at line 371 of file scheduler-commutator.hpp.
References SchedulerCommutator::acquireGoomingToken(), LoadController::DISPATCH, SchedulerCommutator::holdsGroomingToken(), LoadController::IDLEWAIT, LoadController::scatteredDelayTime(), LoadController::SPINTIME, LoadController::tendedNext(), LoadController::tendNext(), LoadController::TENDNEXT, and vault::gear::anonymous_namespace{scheduler-commutator.hpp}::thisThread().
Referenced by SchedulerCommutator::dispatchCapacity(), and SchedulerCommutator::postChain().