diff --git a/src/lib/idi/genfunc.hpp b/src/lib/idi/genfunc.hpp index 49934836d..1a408495b 100644 --- a/src/lib/idi/genfunc.hpp +++ b/src/lib/idi/genfunc.hpp @@ -116,7 +116,7 @@ namespace idi { } /** designation of an distinct object instance - * @par obj pointer to the memory location of the object + * @param obj pointer to the memory location of the object * @return a notation "typename.hash", where the hash is given * as 4 hex digits derived from the memory location */ diff --git a/src/vault/gear/scheduler-commutator.hpp b/src/vault/gear/scheduler-commutator.hpp index 79c94586a..8f5046c66 100644 --- a/src/vault/gear/scheduler-commutator.hpp +++ b/src/vault/gear/scheduler-commutator.hpp @@ -54,6 +54,7 @@ ** In typical usage, Layer-2 of the Scheduler will perform the following operations ** - accept and enqueue new task descriptions (as chain-of-Activities) ** - retrieve the most urgent entry from Layer-1 + ** - silently dispose of any outdated entries ** - use the [Activity Language environment](\ref ActivityLang) to _perform_ ** the retrieved chain within some worker thread; this is called _dispatch_ ** The central cross road of this implementation is the #postDispatch function. @@ -171,7 +172,11 @@ namespace gear { } - /** look into the queues and possibly retrieve work due by now */ + /** + * Look into the queues and possibly retrieve work due by now. + * @note transparently discards any outdated entries, + * but blocks if a compulsory entry becomes outdated. + */ Activity* findWork (SchedulerInvocation& layer1, Time now) { @@ -179,7 +184,9 @@ namespace gear { or acquireGoomingToken()) { layer1.feedPrioritisation(); - if (layer1.isDue (now)) + while (layer1.isOutdated (now) and not layer1.isOutOfTime(now)) + layer1.pullHead(); + if (layer1.isDue (now) and not layer1.isOutOfTime(now)) return layer1.pullHead(); } return nullptr; diff --git a/src/vault/gear/scheduler-invocation.hpp b/src/vault/gear/scheduler-invocation.hpp index 61e78adc1..bba747f07 100644 --- a/src/vault/gear/scheduler-invocation.hpp +++ b/src/vault/gear/scheduler-invocation.hpp @@ -33,6 +33,22 @@ ** use of a _Priority Queue_ — which however must be concurrency protected. ** The Layer-2 thus assures that _mutating operations_ are performed ** exclusively from a special »grooming mode« (management mode). + ** @par Data maintained in Queue Entries + ** - the [Activity itself](\ref SchedulerInvocation::ActOrder::activity) + ** is allocated externally an only referred by pointer; however, this + ** pointer must not be dereferenced after the *deadline* passed. + ** - an entry can be scheduled after reaching the + ** [start time](\ref SchedulerInvocation::ActOrder::waterlevel) + ** - the [deadline](\ref SchedulerInvocation::ActOrder::deathtime) + ** marks latest point in time where starting is still allowed + ** - entries can be tagged with a distinctive + ** [»manifestation ID«](\ref SchedulerInvocation::ActOrder::manifestationID), + ** which allows to filter out complete _families_ of already planned entries + ** - as a safety measure, an entry can be marked as + ** [compulsory](\ref SchedulerInvocation::ActOrder::isCompulsory). + ** In regular operation, this has no effect, but an *emergency state* + ** is triggered in the SchedulerService, should such an entry + ** [miss it's deadline](\ref SchedulerInvocation::isOutOfTime()) ** @see SchedulerCommutator::findWork() ** @see SchedulerCommutator::postDispatch() ** @see SchedulerInvocation_test diff --git a/tests/vault/gear/scheduler-commutator-test.cpp b/tests/vault/gear/scheduler-commutator-test.cpp index c7e055dd0..52d950ae1 100644 --- a/tests/vault/gear/scheduler-commutator-test.cpp +++ b/tests/vault/gear/scheduler-commutator-test.cpp @@ -228,6 +228,7 @@ namespace test { }) .threadID("grooming-hog")); sleep_for (500us); + ENSURE (groomingHog_); } /** @internal stop the background thread to unblock the GrooingToken */ @@ -369,7 +370,7 @@ namespace test { Time t4{40,0}; Activity a4{4u,4u}; queue.instruct (a1, t1, t4, ManifestationID{5}); - queue.instruct (a2, t2, t3); + queue.instruct (a2, t2, t2); queue.instruct (a3, t3, t3, ManifestationID{23}, true); queue.instruct (a4, t4, t4); queue.activate(ManifestationID{5}); @@ -388,13 +389,15 @@ namespace test { CHECK (not sched.findWork(queue, t1)); CHECK (t2 == queue.headTime()); + CHECK (isSameObject (a2, *queue.peekHead())); CHECK (not queue.isMissed (t2)); CHECK (not queue.isOutdated(t2)); CHECK ( queue.isMissed (t3)); CHECK ( queue.isOutdated(t3)); - CHECK (not sched.findWork(queue, t2)); + CHECK (not sched.findWork(queue, t2+Time{5,0})); CHECK (t3 == queue.headTime()); + CHECK (isSameObject (a3, *queue.peekHead())); CHECK (not queue.isMissed (t3)); CHECK (not queue.isOutdated (t3)); CHECK (not queue.isOutOfTime(t3)); @@ -411,7 +414,7 @@ namespace test { CHECK ( queue.isOutdated (t4)); CHECK ( queue.isOutOfTime(t4)); - queue.drop(ManifestationID{5}); + queue.drop(ManifestationID{23}); CHECK (t3 == queue.headTime()); CHECK (not queue.isMissed (t3)); CHECK ( queue.isOutdated (t3)); diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 8a7cd7e28..3bd271f75 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -71355,9 +71355,7 @@ - - - +

um fliegende Änderungen durchführen zu können @@ -72684,9 +72682,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - - +

...dient als Bezugspunkt um im Scheduler einen »fliegenden Wechsel« der unterliegenden Definition zu ermöglichen @@ -81990,9 +81986,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - - +

...und das hatte ich an der Stelle gar nicht erwartet: die tatsächlichen Benutzer eines »Scheduler-Service« gehen nach wenigen festen Schemata vor und müssen überhaupt nichts von einer »Activity-Language« wissen @@ -84036,19 +84030,19 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - - - - + + + + + - - - + + + @@ -84087,7 +84081,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + @@ -84096,9 +84090,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + - + @@ -84113,8 +84107,8 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - + + @@ -84123,11 +84117,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + - - - +

Implementierung: @@ -84137,7 +84129,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200

- + @@ -84204,14 +84196,12 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + - + - - - +

übergreifendes Thema: fliegende Änderungen in Play-Prozessen @@ -84224,9 +84214,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - - +

brauche generische Informationsfunktion isOutdated() @@ -84235,29 +84223,30 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + - - + + - - - - + + + + - - - +

  • @@ -84272,9 +84261,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
    - - - +

    diese spezielle Marker-ID wird implizit stets freigeschaltet, kann also später nicht verworfen werden; das erscheint mir ein sinnvoller Default @@ -84284,9 +84271,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
    - - - +

    verpflichtende Activities sind ebenfalls ein Feature, das eigentlich erst auf Scheduler-Level angesiedelt ist, und hier nur den entsprechenden Support braucht @@ -84295,6 +84280,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
    + @@ -84303,9 +84289,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
    - - - + + + @@ -84319,11 +84305,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
    - + - - - +

    also gehört diese Operation in Layer-2 @@ -84333,9 +84317,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
    - - - +

    damit: direkt in findWork(now) @@ -84344,20 +84326,30 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
    - - - - - - - + + + + +

    + prüft explizit auf isOutdated (now) and not isOutOfTime(now) +

    + +
    - + + + + + + + + + - - + + @@ -88954,7 +88946,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
    - + @@ -88978,7 +88970,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
    - + @@ -89000,7 +88992,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
    - + @@ -89179,9 +89171,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
    - - - + + + @@ -94770,9 +94762,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
    - - - +

    ermöglicht, einen CalcStream inkompatibel zu verändern und die Reste der damit obsoleten Manifestation fliegend zu verwerfen @@ -95429,7 +95419,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
    - +