From c76e5488bd38ff74be1f0b1934f4e5a97aa68542 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 16 Oct 2023 22:46:31 +0200 Subject: [PATCH] Scheduler: plot steps towards integration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (1) SchedulerInvocation_test »Layer-1« : Queue operation (2) SchedulerCommutator_test »Layer-2« : Activity execution (3) SchedulerUsage_test Component End-to-End --- doc/technical/overview.txt | 41 ++-- src/vault/gear/scheduler-invocation.hpp | 4 +- tests/vault/gear/scheduler-activity-test.cpp | 2 +- .../vault/gear/scheduler-invocation-test.cpp | 16 +- wiki/thinkPad.ichthyo.mm | 183 ++++++++++++++++++ 5 files changed, 220 insertions(+), 26 deletions(-) diff --git a/doc/technical/overview.txt b/doc/technical/overview.txt index c401a36ba..1026a2cc7 100644 --- a/doc/technical/overview.txt +++ b/doc/technical/overview.txt @@ -303,8 +303,25 @@ invoke and control the dependency and time based execution of the _Render Jobs._ Regarding architecture, the Scheduler is located in the Vault-Layer and running the Scheduler is equivalent to activating the »Vault Subsystem«. An EngineFaçade acts as entrance point, providing high-level render services to other parts of the application: render jobs can be -activated under various timing and dependency constraints. -Internally, the implementation is organised into two layers: +activated under various timing and dependency constraints, which can be grouped +into three basic modes of control: + +Deadline:: + Higher priority jobs ordered by a deadline time plus some (negative) hysteresis. + Jobs are started when they approach their deadline. When it is foreseeable that a + jobs will miss the deadline, it will be skipped, preferring to use resources on + calculations expected to be successful and on time. + +Best Effort:: + Background calculations will use excess resources of the system; + a typical example would be the calculation of preview images and sound waveform + outlines for the GUI. + +Freewheeling:: + Calculation for final rendering will use all available resources and never + skip any processing, irrespective of the time it takes to complete. + +Internally, the implementation of the Scheduler is organised in two layers: Layer-2: Coordination:: Maintain a network of interconnected activities, track dependencies and observe @@ -313,28 +330,10 @@ Layer-2: Coordination:: Layer-1: Invocation:: Operates a low-level priority scheduling mechanism for time-bound execution of activities. -Generally speaking, a render calculation can be organised by different modes of control: - -.Deadline -Higher priority jobs ordered by a deadline time plus some (negative) hysteresis. -Jobs are started when they approach their deadline. When it is foreseeable that a -jobs will miss the deadline, it will be skipped, preferring to use resources on -calculations expected to be successful and in time. - -.Background -Background calculations will use excess resources of the system; -a typical example would be the calculation of preview images and sound waveform -outlines for the GUI. - -.Best Effort -Calculation for final rendering will use all available resources and never skip any -processing, irrespecive of the time it takes to complete. - - Job ^^^ A _Render Job_ is prepared as a self-contained functor, with a well defined time window -of execution. A job, once triggered, will run to completion without and can not be aborted. +of execution. A job, once triggered, will run to completion unattended and can not be aborted. The scheduler is able to observe and maintain dependencies between render jobs, allowing to break down an extended calculation into a chain of small steps. diff --git a/src/vault/gear/scheduler-invocation.hpp b/src/vault/gear/scheduler-invocation.hpp index 724e23f97..4fa11072e 100644 --- a/src/vault/gear/scheduler-invocation.hpp +++ b/src/vault/gear/scheduler-invocation.hpp @@ -29,7 +29,7 @@ ** @see SchedulerUsage_test integrated usage ** @see scheduler.cpp implementation details ** - ** @todo WIP-WIP-WIP 6/2023 »Playback Vertical Slice« + ** @todo WIP-WIP-WIP 10/2023 »Playback Vertical Slice« ** */ @@ -60,7 +60,7 @@ namespace gear { /** - * Scheduler Layer-2 : invocation. + * Scheduler Layer-1 : invocation. * * @see Scheduler * @see SchedulerInvocation_test diff --git a/tests/vault/gear/scheduler-activity-test.cpp b/tests/vault/gear/scheduler-activity-test.cpp index ace0251df..158d33041 100644 --- a/tests/vault/gear/scheduler-activity-test.cpp +++ b/tests/vault/gear/scheduler-activity-test.cpp @@ -279,7 +279,7 @@ namespace test { * - when receiving a notification, the latch is decremented * - if this causes the Gate to open, the chain is immediately * scheduled for activation, but the Gate also locked forever - * - neither a further activation, or a further notification + * - neither a further activation, nor a further notification * has any effect after this point... */ void diff --git a/tests/vault/gear/scheduler-invocation-test.cpp b/tests/vault/gear/scheduler-invocation-test.cpp index d09c70356..2e4fa4b2e 100644 --- a/tests/vault/gear/scheduler-invocation-test.cpp +++ b/tests/vault/gear/scheduler-invocation-test.cpp @@ -29,13 +29,13 @@ #include "vault/gear/scheduler-invocation.hpp" //#include "lib/time/timevalue.hpp" //#include "lib/format-cout.hpp" -//#include "lib/util.hpp" +#include "lib/util.hpp" //#include using test::Test; //using std::move; -//using util::isSameObject; +using util::isSameObject; namespace vault{ @@ -72,6 +72,18 @@ namespace test { void simpleUsage() { + SchedulerInvocation sched; + Activity activity; + + CHECK (not sched.peekHead()); + + sched.instruct (activity); + sched.feedPriorisation(); + CHECK (sched.peekHead()); + + Activity* head = sched.pullHead(); + CHECK (not sched.peekHead()); + CHECK (isSameObject (*head, activity)); } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index d042ed195..19035a2ba 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -81671,6 +81671,46 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + + + + + + +

+ wird das hier auf Layer-1 realisiert — +

+

+ oder bietet Layer-1 einen Direkt-Eingang? +

+ +
+ + + + + + + +

+ single level of abstraction / do only one thing and do it well +

+ +
+
+ + + +
+ + + + +
@@ -84812,6 +84852,43 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + +

+ ...sie ist entstanden aus den ersten Analysen, als die Bedeutung der »Activity-Language« noch nicht geklärt war +

+ +
+
+ + + +
@@ -85682,18 +85759,124 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ offen: wie erfolgt hier der »Seed« ? +

+ + +
+ + + + + + + +

+ typischerweise ist das eine Planungs-Activity, also ein activity::Term::META_JOB +

+ + +
+
+ + + + + + + + + + + + + +

+ ...was schlimmstenfalls dazu führt, daß er direkt den ersten Planungs-Chunk ausführt +

+ + +
+
+ + + + + + +

+ ...und würde dadurch dann nach dem Meta-Job auch gleich noch den ersten Frame-Job ausführen, was aber genau so auch wünschenswert ist +

+ + +
+
+
+
+
+
+
+ + + + + + + + +