Lumiera  0.pre.03
»edit your freedom«
activity.hpp File Reference

Go to the source code of this file.

Description

Descriptor for a piece of operational logic performed by the scheduler.

The Scheduler in Lumiera's Vault coordinates the rendering activities, by passing and responding to Activity messages, thereby observing temporal limits (deadlines) and dependency constraints. A predefined and fixed set of Activity verbs defines atomic operations the engine is able to perform, directed by the scheduler. Complex calculation tasks are constructed from interconnected activities, passed through the messaging and priority queue of the scheduler. While an Activity is in processing, the corresponding descriptor data record is maintained by the BlockStream custom memory manager.

Performing Activities

The Activity data records are »POD with constructor« and can be created and copied freely; the provided constructors ensure consistent setup, since the meaning of the variant data depends on the Activity::verb_. However, in actual usage, the builder functionality of the ActivityLang is used to generate linked »Activity terms«, connecting chains of Activities in accordance with an implicit execution protocol, which also forms the base of the Activity state machine:

  • Activity::activate is invoked only once, when an Activity becomes active.
  • the provided Execution Context is connected through several λ-bindings with the actual execution logic, as provided by »Layer-2« of the Scheduler
  • Activity::dispatch is always invoked from within the scheduler and implies single threaded operation with the ability to mutate the scheduler queue; typically this happens after de-queuing an Activity from the priority queue and leads then to Activation of the retrieved Activity; however, it can also happen right away — when the indicated time has passed.
  • Activity::INVOKE represents the relevant case of a »Render Job« and is typically performed by workers running concurrently
  • Activity::notify receives a message/trigger from another prerequisite Activity
See also
SchedulerActivity_test
ActivityLang implementation of execution logic

Definition in file activity.hpp.

#include "vault/common.hpp"
#include "vault/gear/job.h"
#include "lib/time/timevalue.hpp"
#include "lib/meta/function.hpp"
#include "lib/util.hpp"

Classes

class  Activity
 Record to describe an Activity, to happen within the Scheduler's control flow. More...
 
union  Activity::ArgumentData
 Storage of Argument data dependent on Activity::verb_. More...
 
struct  Activity::Callback
 Extension point to invoke. More...
 
struct  Activity::Condition
 Access gate condition to evaluate. More...
 
struct  Activity::Feed
 Payload data to provide. More...
 
class  Hook
 Extension point to invoke a callback from Activity activation. More...
 
class  Instant
 < special definitions for the Scheduler activity language More...
 
struct  Activity::Invocation
 External work functor to activate. More...
 
class  ManifestationID
 Marker for current (and obsolete) manifestations of a CalcStream processed by the Render-Engine. More...
 
struct  Activity::Notification
 Notification towards another Activity. More...
 
struct  Activity::TimeWindow
 Time window to define for activation. More...
 
struct  Activity::Timing
 Timing observation to propagate. More...
 

Enumerations

enum  Proc {
  PASS,
  SKIP,
  WAIT,
  KICK,
  HALT
}
 Result instruction from Activity activation. More...
 

Functions

template<class EXE >
constexpr void _verify_usable_as_ExecutionContext ()
 Definition to emulate a Concept for the Execution Context. More...
 
HashVal hash_value (ManifestationID const &id)
 

Namespaces

 vault
 Vault-Layer implementation namespace root.
 
 vault::gear
 Active working gear and plumbing.
 

Enumeration Type Documentation

◆ Proc

enum Proc

Result instruction from Activity activation.

These codes are used by the ActivityLang and WorkForce to coordinate further processing of activities.

Enumerator
PASS 

pass on the activation down the chain

SKIP 

skip rest of the Activity chain for good

WAIT 

nothing to do; wait and re-check for work later

KICK 

back pressure; get out of the way but be back soon

HALT 

abandon this play / render process

Definition at line 149 of file activity.hpp.


Class Documentation

◆ vault::gear::Activity::ArgumentData

union vault::gear::Activity::ArgumentData
Class Members
Feed feed
Timing timing
Callback callback
Condition condition
TimeWindow timeWindow
Invocation invocation
Notification notification
+ Collaboration diagram for Activity::ArgumentData:

◆ vault::gear::Activity::Callback

struct vault::gear::Activity::Callback
Class Members
Hook * hook
size_t arg
+ Collaboration diagram for Activity::Callback:

◆ vault::gear::Activity::Feed

struct vault::gear::Activity::Feed
Class Members
uint64_t one
uint64_t two
+ Collaboration diagram for Activity::Feed:

◆ vault::gear::Activity::Invocation

struct vault::gear::Activity::Invocation
Class Members
JobFunctor * task
Instant time
+ Collaboration diagram for Activity::Invocation:

◆ vault::gear::Activity::Notification

struct vault::gear::Activity::Notification
Class Members
Activity * target
Instant timing
+ Collaboration diagram for Activity::Notification:

◆ vault::gear::Activity::TimeWindow

struct vault::gear::Activity::TimeWindow
Class Members
Instant life
Instant dead
+ Collaboration diagram for Activity::TimeWindow:

◆ vault::gear::Activity::Timing

struct vault::gear::Activity::Timing
Class Members
Instant instant
size_t quality
+ Collaboration diagram for Activity::Timing:

Function Documentation

◆ _verify_usable_as_ExecutionContext()

constexpr void vault::gear::activity::_verify_usable_as_ExecutionContext ( )

Definition to emulate a Concept for the Execution Context.

The Execution Context need to be passed to any Activity activation; it provides the bindings for functionality defined only on a conceptual level, and provided by an opaque implementation (actually the Scheduler)

Definition at line 212 of file activity.hpp.

References vault::gear::activity::_verify_usable_as_ExecutionContext(), and ASSERT_MEMBER_FUNCTOR.

Referenced by vault::gear::activity::_verify_usable_as_ExecutionContext().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: