Lumiera
0.pre.03
»edit your freedom«
|
#include "vault/gear/scheduler.hpp"
»Scheduler-Service« : coordinate render activities.
Definition at line 213 of file scheduler.hpp.
Public Member Functions | |
Scheduler (BlockFlowAlloc &activityAllocator, EngineObserver &engineObserver) | |
void | continueMetaJob (Time nextStart, Job planningJob, ManifestationID manID=ManifestationID()) |
Place a follow-up job-planning job into the timeline. | |
ScheduleSpec | defineSchedule (Job job) |
Render Job builder: start definition of a schedule to invoke the given Job. More... | |
activity::Proc | doWork () |
The worker-Functor: called by the active Workers from the WorkForce to pull / perform the actual render Activities. More... | |
bool | empty () const |
double | getLoadIndicator () |
void | ignite () |
Spark the engine self-regulation cycle and power up WorkForce. More... | |
void | seedCalcStream (Job planningJob, ManifestationID manID=ManifestationID(), FrameRate expectedAdditionalLoad=FrameRate(25)) |
Set the Scheduler to work on a new CalcStream. More... | |
void | terminateProcessing () |
Bring down processing destructively as fast as possible. More... | |
Classes | |
class | ExecutionCtx |
struct | Setup |
Binding of worker callbacks to the scheduler implementation. More... | |
Friends | |
class | ExecutionCtx |
class | ScheduleSpec |
the Job builder is allowed to allocate and dispatch | |
class | test::SchedulerService_test |
open private backdoor for tests | |
Private Member Functions | |
LoadController::Wiring | connectMonitoring () |
Time | getSchedTime () |
access high-resolution-clock, rounded to µ-Ticks | |
void | handleDutyCycle (Time now, bool=false) |
»Tick-hook« : code to maintain a sane running status. More... | |
void | handleWorkerTermination (bool isFailure) |
Callback invoked whenever a worker-thread is about to exit. More... | |
void | maybeScaleWorkForce (Time startHorizon) |
Hook invoked whenever a new task is passed in. More... | |
void | postChain (ActivationEvent) |
Enqueue for time-bound execution, possibly dispatch immediately. More... | |
void | sanityCheck (ActivationEvent const &) |
void | triggerEmergency () |
Trip the emergency brake and unwind processing while retaining all state. More... | |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
Private Attributes | |
ActivityLang | activityLang_ |
EngineObserver & | engineObserver_ |
SchedulerInvocation | layer1_ |
SchedulerCommutator | layer2_ |
LoadController | loadControl_ |
WorkForce< Setup > | workForce_ |
|
inline |
Spark the engine self-regulation cycle and power up WorkForce.
Definition at line 259 of file scheduler.hpp.
|
inline |
Bring down processing destructively as fast as possible.
Dismiss worker threads as soon as possible, and clear the queues.
Definition at line 278 of file scheduler.hpp.
|
inline |
Definition at line 292 of file scheduler.hpp.
References LoadController::effectiveLoad().
|
inline |
Set the Scheduler to work on a new CalcStream.
planningJob | a »meta-Job« to schedule a chunk of render-Jobs. |
manID | (optional) a manifestation-ID to be enabled for processing |
Definition at line 318 of file scheduler.hpp.
References SchedulerInvocation::activate(), ActivityLang::announceLoad(), and SchedulerCommutator::requireGroomingTokenHere().
Referenced by TestChainLoad< maxFan >::ScheduleCtx::continuation().
|
inline |
Render Job builder: start definition of a schedule to invoke the given Job.
Use the functions on the returned builder to fill in the details of the schedule; defining a start point and a deadline is mandatory. Issue this schedule then by invoking post()
Definition at line 357 of file scheduler.hpp.
Referenced by TestChainLoad< maxFan >::ScheduleCtx::continuation(), and TestChainLoad< maxFan >::ScheduleCtx::disposeStep().
|
inline |
The worker-Functor: called by the active Workers from the WorkForce to pull / perform the actual render Activities.
Definition at line 520 of file scheduler.hpp.
References SchedulerCommutator::dispatchCapacity(), and ActivityLang::dispatchChain().
|
inlineprivate |
Enqueue for time-bound execution, possibly dispatch immediately.
This is the »main entrance« to get some Activity scheduled.
actEvent | the Activity, start time and deadline and optionally further context information |
Definition at line 620 of file scheduler.hpp.
References SchedulerCommutator::postChain().
|
inlineprivate |
»Tick-hook« : code to maintain a sane running status.
This function will be invoked regularly while the scheduler is actively processing; in fact this function determines when the scheduler falls empty and can be shut down — and thus regular invocation is equivalent to running state. Code for all kinds of status updates, low-level clean-up and maintenance work related to the building blocks of the scheduler shall be added here. It will be invoked from within some (random) worker thread, frequently enough for humans to seem like an immediate response, but with sufficient large time period to amortise even slightly more computational expensive work; IO and possibly blocking operations should be avoided here though. Exceptions emanating from here will shut down the engine.
forceContinuation | whether a follow-up DutyCycle must happen, irrespective if the queue has still further entries. Used on first Tick-Cycle directly after ignition, which is then also shortened (to improve scheduling precision) |
Definition at line 647 of file scheduler.hpp.
References ActivityLang::createTick(), ActivityLang::discardBefore(), vault::gear::anonymous_namespace{scheduler.hpp}::DUTY_CYCLE_PERIOD, vault::gear::anonymous_namespace{scheduler.hpp}::DUTY_CYCLE_TOLERANCE, SchedulerCommutator::maintainQueueHead(), SchedulerCommutator::postChain(), SchedulerCommutator::requireGroomingTokenHere(), LoadController::updateState(), and vault::gear::anonymous_namespace{load-controller.hpp}::WORK_HORIZON.
Referenced by Scheduler::ExecutionCtx::tick().
|
inlineprivate |
Callback invoked whenever a worker-thread is about to exit.
isFailuere | if the exit was caused by uncaught exception |
Definition at line 678 of file scheduler.hpp.
References LoadController::markWorkerExit().
|
inlineprivate |
Hook invoked whenever a new task is passed in.
Ensures that the Scheduler is in running state and possibly steps up the WorkForce if not yet running at full computation power.
Definition at line 695 of file scheduler.hpp.
References LoadController::ensureCapacity().
|
inlineprivate |
Trip the emergency brake and unwind processing while retaining all state.
SchedulerCommutatior::findWork()
, where emergency can happen, yet in its current configuration, the Layer-2 has no access to the top-level Scheduler component. /////////////////////////////////////////////////TICKET #1362 : where to handle Scheduler-Emergency Definition at line 713 of file scheduler.hpp.
|
inlineprivate |
connect state signals for use by the LoadController
Definition at line 383 of file scheduler.hpp.
References Config::COMPUTATION_CAPACITY, and vault::gear::test::anonymous_namespace{work-force-test.cpp}::setup().