![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "vault/gear/scheduler-commutator.hpp"
Scheduler Layer-2 : execution of Scheduler Activities.
Definition at line 107 of file scheduler-commutator.hpp.
Classes | |
| class | ScopedGroomingGuard |
| struct | WorkerInstruction |
| monad-like step sequence: perform sequence of steps, as long as the result remains activity::PASS More... | |
Public Member Functions | |
| SchedulerCommutator ()=default | |
| bool | acquireGoomingToken () noexcept |
| acquire the right to perform internal state transitions. | |
| void | dropGroomingToken () noexcept |
| relinquish the right for internal state transitions. | |
| bool | holdsGroomingToken (ThreadID id) noexcept |
| check if the indicated thread currently holds the right to conduct internal state transitions. | |
| ScopedGroomingGuard | requireGroomingTokenHere () |
| a scope guard to force acquisition of the GroomingToken | |
| void | maybeFeed (SchedulerInvocation &layer1) |
| tend to the input queue if possible | |
| bool | maintainQueueHead (SchedulerInvocation &layer1, Time now) |
| update queue head to discard obsolete content. | |
| ActivationEvent | findWork (SchedulerInvocation &layer1, Time now) |
| Look into the queues and possibly retrieve work due by now. | |
| activity::Proc | postChain (ActivationEvent event, SchedulerInvocation &layer1) |
| This is the primary entrance point to the Scheduler. | |
| template<class DISPATCH , class CLOCK > | |
| activity::Proc | dispatchCapacity (SchedulerInvocation &, LoadController &, DISPATCH, CLOCK) |
| Implementation of the worker-Functor: | |
Private Types | |
| using | ThreadID = std::thread::id |
Private Member Functions | |
| 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. | |
| void | ensureDroppedGroomingToken () |
Private Member Functions inherited from NonCopyable | |
| ~NonCopyable ()=default | |
| NonCopyable ()=default | |
| NonCopyable (NonCopyable const &)=delete | |
| NonCopyable & | operator= (NonCopyable const &)=delete |
Private Attributes | |
| atomic< ThreadID > | groomingToken_ {} |
|
default |
|
private |
Definition at line 110 of file scheduler-commutator.hpp.
|
inlinenoexcept |
acquire the right to perform internal state transitions.
true if this attempt succeeded Definition at line 126 of file scheduler-commutator.hpp.
References SchedulerCommutator::groomingToken_.
Referenced by SchedulerCommutator_test::___ensureGroomingTokenReleased(), SchedulerCommutator_test::blockGroomingToken(), SchedulerCommutator::ScopedGroomingGuard::ensureHoldsToken(), SchedulerCommutator::findWork(), SchedulerCommutator::maybeFeed(), SchedulerCommutator::scatteredDelay(), and SchedulerCommutator_test::verify_postChain().
Here is the caller graph for this function:
|
inlinenoexcept |
relinquish the right for internal state transitions.
Definition at line 142 of file scheduler-commutator.hpp.
References SchedulerCommutator::groomingToken_.
Referenced by SchedulerCommutator::ScopedGroomingGuard::~ScopedGroomingGuard(), SchedulerCommutator_test::___ensureGroomingTokenReleased(), SchedulerCommutator_test::blockGroomingToken(), SchedulerCommutator::ensureDroppedGroomingToken(), SchedulerCommutator_test::integratedWorkCycle(), SchedulerCommutator_test::verify_postChain(), and Scheduler::ExecutionCtx::work().
Here is the caller graph for this function:
|
inlinenoexcept |
check if the indicated thread currently holds the right to conduct internal state transitions.
Definition at line 154 of file scheduler-commutator.hpp.
References SchedulerCommutator::groomingToken_.
Referenced by SchedulerCommutator::ScopedGroomingGuard::~ScopedGroomingGuard(), SchedulerCommutator_test::___ensureGroomingTokenReleased(), SchedulerCommutator_test::blockGroomingToken(), SchedulerCommutator::ensureDroppedGroomingToken(), SchedulerCommutator::ScopedGroomingGuard::ensureHoldsToken(), SchedulerCommutator::findWork(), SchedulerCommutator_test::integratedWorkCycle(), SchedulerCommutator::maintainQueueHead(), SchedulerCommutator::maybeFeed(), SchedulerCommutator::postChain(), SchedulerCommutator::scatteredDelay(), SchedulerCommutator_test::verify_dispatch(), and SchedulerCommutator_test::verify_postChain().
Here is the caller graph for this function:
|
inline |
a scope guard to force acquisition of the GroomingToken
Definition at line 462 of file scheduler-commutator.hpp.
Referenced by Scheduler::handleDutyCycle(), and Scheduler::seedCalcStream().
Here is the caller graph for this function:
|
inline |
tend to the input queue if possible
Definition at line 168 of file scheduler-commutator.hpp.
References SchedulerCommutator::acquireGoomingToken(), SchedulerInvocation::feedPrioritisation(), SchedulerInvocation::hasPendingInput(), and SchedulerCommutator::holdsGroomingToken().
Referenced by SchedulerCommutator::dispatchCapacity().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
update queue head to discard obsolete content.
| now | current time to use for decision about dropping tasks |
false when failing to establish a consistent state due to missed compulsory entries; should cause Emergency halt. Definition at line 182 of file scheduler-commutator.hpp.
References SchedulerInvocation::feedPrioritisation(), SchedulerCommutator::holdsGroomingToken(), SchedulerInvocation::isOutdated(), SchedulerInvocation::isOutOfTime(), and SchedulerInvocation::pullHead().
Referenced by SchedulerCommutator::findWork(), and Scheduler::handleDutyCycle().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Look into the queues and possibly retrieve work due by now.
Definition at line 197 of file scheduler-commutator.hpp.
References SchedulerCommutator::acquireGoomingToken(), SchedulerInvocation::feedPrioritisation(), SchedulerCommutator::holdsGroomingToken(), SchedulerInvocation::isDue(), SchedulerInvocation::isOutdated(), SchedulerInvocation::isOutOfTime(), SchedulerCommutator::maintainQueueHead(), and SchedulerInvocation::pullHead().
Referenced by SchedulerCommutator_test::demonstrateSimpleUsage(), SchedulerCommutator::dispatchCapacity(), SchedulerCommutator_test::integratedWorkCycle(), SchedulerCommutator_test::verify_findWork(), SchedulerCommutator_test::verify_postChain(), and SchedulerCommutator_test::verify_Significance().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 231 of file scheduler-commutator.hpp.
References SchedulerInvocation::feedPrioritisation(), SchedulerCommutator::holdsGroomingToken(), SchedulerInvocation::instruct(), and vault::gear::activity::PASS.
Referenced by Scheduler::handleDutyCycle(), SchedulerCommutator_test::integratedWorkCycle(), Scheduler::ExecutionCtx::post(), Scheduler::postChain(), SchedulerService_test::postNewTask(), and SchedulerCommutator_test::verify_postChain().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Implementation of the worker-Functor:
Definition at line 318 of file scheduler-commutator.hpp.
References SchedulerCommutator::ensureDroppedGroomingToken(), SchedulerCommutator::findWork(), SchedulerInvocation::headTime(), vault::gear::activity::KICK, LoadController::markIncomingCapacity(), LoadController::markOutgoingCapacity(), SchedulerCommutator::maybeFeed(), vault::gear::activity::PASS, SchedulerCommutator::WorkerInstruction::performStep(), and SchedulerCommutator::scatteredDelay().
Referenced by Scheduler::doWork(), and SchedulerCommutator_test::verify_dispatch().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 375 of file scheduler-commutator.hpp.
References SchedulerCommutator::acquireGoomingToken(), LoadController::DISPATCH, SchedulerCommutator::ensureDroppedGroomingToken(), SchedulerCommutator::holdsGroomingToken(), LoadController::IDLEWAIT, vault::gear::activity::PASS, LoadController::scatteredDelayTime(), vault::gear::activity::SKIP, LoadController::SPINTIME, LoadController::tendedNext(), LoadController::tendNext(), LoadController::TENDNEXT, and vault::gear::activity::WAIT.
Referenced by SchedulerCommutator::dispatchCapacity().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 259 of file scheduler-commutator.hpp.
References SchedulerCommutator::dropGroomingToken(), and SchedulerCommutator::holdsGroomingToken().
Referenced by SchedulerCommutator::dispatchCapacity(), and SchedulerCommutator::scatteredDelay().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 111 of file scheduler-commutator.hpp.
Referenced by SchedulerCommutator::acquireGoomingToken(), SchedulerCommutator::dropGroomingToken(), and SchedulerCommutator::holdsGroomingToken().
Inheritance diagram for SchedulerCommutator:
Collaboration diagram for SchedulerCommutator: