Lumiera  0.pre.03
»edit your freedom«
SchedulerInvocation Class Reference

#include "vault/gear/scheduler-invocation.hpp"

Description

Scheduler Layer-1 : time based dispatch.

Manages pointers to Render Activity records.

  • new entries passed in through the #instruct_ queue
  • time based prioritisation in the #priority_ queue
    Warning
    not threadsafe; requires Layer-2 to coordinate.
    See also
    Scheduler
    SchedulerInvocation_test

Definition at line 148 of file scheduler-invocation.hpp.

Public Member Functions

void activate (ManifestationID manID)
 Enable entries marked with a specific ManifestationID to be processed. More...
 
void discardSchedule ()
 forcibly clear out the schedule
 
void drop (ManifestationID manID)
 
bool empty () const
 
void feedPrioritisation ()
 Pick up all new events from the entrance queue and enqueue them to be retrieved ordered by start time.
 
void feedPrioritisation (ActivationEvent actEvent)
 Feed the given Activity directly into time prioritisation, effectively bypassing the thread dispatching entrance queue. More...
 
bool hasPendingInput () const
 
Time headTime () const
 
void instruct (ActivationEvent actEvent)
 Accept an ActivationEvent with an Activity for time-bound execution.
 
bool isActivated (ManifestationID manID) const
 determine if Activities with the given ManifestationID shall be processed
 
bool isDue (Time now) const
 Determine if there is work to do right now.
 
bool isMissed (Time now) const
 determine if the Activity at scheduler head missed it's deadline. More...
 
bool isOutdated (Time now) const
 determine if Activity at scheduler is outdated and should be discarded
 
bool isOutOfTime (Time now) const
 detect a compulsory Activity at scheduler head with missed deadline
 
ActivationEvent peekHead ()
 
ActivationEvent pullHead ()
 Retrieve from the scheduling queue the entry with earliest start time. More...
 

Private Types

using ActivationSet = std::unordered_set< ManifestationID >
 
using InstructQueue = boost::lockfree::queue< ActivationEvent >
 
using PriorityQueue = std::priority_queue< ActivationEvent >
 

Static Private Member Functions

static int64_t waterLevel (Time time)
 

Private Attributes

ActivationSet allowed_
 
InstructQueue instruct_
 
PriorityQueue priority_
 

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Member Function Documentation

◆ feedPrioritisation()

void feedPrioritisation ( ActivationEvent  actEvent)
inline

Feed the given Activity directly into time prioritisation, effectively bypassing the thread dispatching entrance queue.

Remarks
Layer-2 uses this shortcut when in »grooming mode«.

Definition at line 208 of file scheduler-invocation.hpp.

◆ peekHead()

ActivationEvent peekHead ( )
inline
Returns
»empty marker« if the queue is empty, else a copy of the currently most urgent element (without dequeuing it).

Definition at line 219 of file scheduler-invocation.hpp.

Referenced by SchedulerInvocation_test::simpleUsage(), SchedulerInvocation_test::verify_isDue(), SchedulerCommutator_test::verify_postChain(), SchedulerInvocation_test::verify_Queuing(), and SchedulerInvocation_test::verify_WaterLevel().

+ Here is the caller graph for this function:

◆ pullHead()

ActivationEvent pullHead ( )
inline

Retrieve from the scheduling queue the entry with earliest start time.

Returns
»empty marker« if the prioritisation queue is empty, else a pointer to the most urgent Activity dequeued thereby.
Remarks
Activity Records are managed by the BlockFlow allocator.

Definition at line 232 of file scheduler-invocation.hpp.

Referenced by SchedulerCommutator::findWork(), SchedulerCommutator::maintainQueueHead(), SchedulerInvocation_test::simpleUsage(), SchedulerInvocation_test::verify_isDue(), SchedulerCommutator_test::verify_postChain(), SchedulerInvocation_test::verify_Queuing(), SchedulerInvocation_test::verify_stability(), and SchedulerInvocation_test::verify_WaterLevel().

+ Here is the caller graph for this function:

◆ activate()

void activate ( ManifestationID  manID)
inline

Enable entries marked with a specific ManifestationID to be processed.

By default, entries are marked with the default ManifestationID, which is always implicitly activated. Any other ID must be actively allowed, otherwise the entry is deemed outdated and will be silently discarded in regular processing by Layer-2.

Remarks
this feature allows to supersede part of a schedule

Definition at line 249 of file scheduler-invocation.hpp.

Referenced by Scheduler::seedCalcStream().

+ Here is the caller graph for this function:

◆ isMissed()

bool isMissed ( Time  now) const
inline

determine if the Activity at scheduler head missed it's deadline.

Warning
due to memory management, such an Activity must not be dereferenced

Definition at line 275 of file scheduler-invocation.hpp.

◆ headTime()

Time headTime ( ) const
inline
Returns
the earliest time of prioritised work

Definition at line 323 of file scheduler-invocation.hpp.

References Time::NEVER.

Referenced by SchedulerCommutator::dispatchCapacity(), SchedulerCommutator_test::verify_dispatch(), and SchedulerCommutator_test::verify_postChain().

+ Here is the caller graph for this function:
+ Inheritance diagram for SchedulerInvocation:
+ Collaboration diagram for SchedulerInvocation:

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