From 523586570fcfb3abed953a4b5ad40135e8a53762 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Tue, 19 Dec 2023 21:51:33 +0100 Subject: [PATCH] =?UTF-8?q?Scheduler-test:=20refactor=20and=20clarify=20?= =?UTF-8?q?=CE=BB-post?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the course of the last refactorings, a slight change in processing order was introduced, which turned out to improve parallelisation considerably. - Some further implementation logic can be relegated into the ActivationEvent - the handling of start times now also incldues a check for sake of symmetry - document the semantics change: λ-post no longer dispatches directly --- src/vault/gear/scheduler-invocation.hpp | 8 +++++++ src/vault/gear/scheduler.hpp | 8 +++---- wiki/thinkPad.ichthyo.mm | 28 ++++++++++++++++++++++++- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/vault/gear/scheduler-invocation.hpp b/src/vault/gear/scheduler-invocation.hpp index 5b49c1589..dce1de6c8 100644 --- a/src/vault/gear/scheduler-invocation.hpp +++ b/src/vault/gear/scheduler-invocation.hpp @@ -132,6 +132,14 @@ namespace gear { Time startTime() const { return Time{TimeValue{starting}};} Time deathTime() const { return Time{TimeValue{deadline}};} + + void + refineTo (Activity* chain, Time when, Time dead) + { + activity = chain; + starting = _raw(activity->constrainedStart (when.isRegular()? when:startTime())); + deadline = _raw(activity->constrainedDeath (dead.isRegular()? dead:deathTime())); + } }; diff --git a/src/vault/gear/scheduler.hpp b/src/vault/gear/scheduler.hpp index 1beeb2412..16696567f 100644 --- a/src/vault/gear/scheduler.hpp +++ b/src/vault/gear/scheduler.hpp @@ -511,16 +511,16 @@ namespace gear { * of activations and notifications. The concrete implementation * needs some further contextual information, which is passed * down here as a nested sub-context. + * @note different than Scheduler::postChain(), this operation here + * always enqueues the \a chain, never dispatches directly. + * This special twist helps to improve parallelisation. */ activity::Proc post (Time when, Time dead, Activity* chain, ExecutionCtx& ctx) { REQUIRE (chain); ActivationEvent chainEvent = ctx.rootEvent; - chainEvent.activity = chain; - chainEvent.starting = _raw(chain->constrainedStart (when)); - chainEvent.deadline = _raw(chain->constrainedDeath (dead.isRegular()? dead:chainEvent.deathTime())); -// ExecutionCtx subCtx{scheduler_, chainEvent}; + chainEvent.refineTo (chain, when, dead); return scheduler_.layer2_.instructFollowUp (chainEvent, scheduler_.layer1_); } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index e5db84ca8..b9d206f23 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -104755,6 +104755,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ @@ -105210,8 +105211,33 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + + + + + + + + + + +

+ das ist nicht gut +

+ +
+ + + +

+ ...denn es führt dazu, daß ab der 2. Schleifen-Iteration die Allokation neuer Activities nicht mehr geschützt ist; das könnte den beobachteten Crash erklären +

+ +
+ + +