Block-Flow: select suitable Epoch for new allocation
This commit is contained in:
parent
cb2ee9466b
commit
dce65104aa
3 changed files with 80 additions and 45 deletions
|
|
@ -300,7 +300,41 @@ namespace gear {
|
|||
}
|
||||
else
|
||||
{//find out how the given time relates to existing Epochs
|
||||
UNIMPLEMENTED ("search through existing Epochs to locate the latest one to support given deadline");
|
||||
if (firstEpoch().deadline() >= deadline)
|
||||
// way into the past ... put it in the first available Epoch
|
||||
return AllocatorHandle{alloc_.begin()};
|
||||
else
|
||||
if (lastEpoch().deadline() < deadline)
|
||||
{ // a deadline beyond the established Epochs...
|
||||
// create a grid of new epochs up to the requested point
|
||||
TimeVar lastDeadline = lastEpoch().deadline();
|
||||
auto distance = _raw(deadline) - _raw(lastDeadline);
|
||||
EpochIter nextEpoch{alloc_.end()};
|
||||
ENSURE (not nextEpoch); // not valid yet, but we will allocate starting there...
|
||||
auto requiredNew = distance / _raw(epochStep_);
|
||||
if (distance % _raw(epochStep_) > 0)
|
||||
++requiredNew; // fractional: requested deadline lies within last epoch
|
||||
alloc_.openNew(requiredNew); // Note: epochHandle now points to the first new Epoch
|
||||
for ( ; 0 < requiredNew; --requiredNew)
|
||||
{
|
||||
REQUIRE (nextEpoch);
|
||||
lastDeadline += epochStep_;
|
||||
Epoch::setup (nextEpoch, lastDeadline);
|
||||
if (deadline <= lastDeadline)
|
||||
{
|
||||
ENSURE (requiredNew == 1);
|
||||
return AllocatorHandle{nextEpoch};
|
||||
} // break out and return handle to allocate into the matching Epoch
|
||||
++nextEpoch;
|
||||
}
|
||||
NOTREACHED ("Logic of counting new Epochs");
|
||||
}
|
||||
else
|
||||
for (EpochIter epochIt{alloc_.begin()}; epochIt; ++epochIt)
|
||||
if (epochIt->deadline() >= deadline)
|
||||
return AllocatorHandle{epochIt};
|
||||
|
||||
NOTREACHED ("Inconsistency in BlockFlow Epoch deadline organisation");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -221,17 +221,17 @@ namespace test {
|
|||
CHECK (watch(bFlow).find(a1) == "10s200ms"_expect);
|
||||
|
||||
auto& a3 = bFlow.until(t3).create();
|
||||
CHECK (watch(bFlow).allEpochs() == "10s200ms|10s400ms|10s600ms|10s800ms|11s0ms"_expect);
|
||||
CHECK (watch(bFlow).find(a3) == "11s0ms"_expect);
|
||||
CHECK (watch(bFlow).allEpochs() == "10s200ms|10s400ms|10s600ms|10s800ms|11s"_expect);
|
||||
CHECK (watch(bFlow).find(a3) == "11s"_expect);
|
||||
|
||||
auto& a2 = bFlow.until(t2).create();
|
||||
CHECK (watch(bFlow).allEpochs() == "10s200ms|10s400ms|10s600ms|10s800ms|11s00ms"_expect);
|
||||
CHECK (watch(bFlow).find(a2) == "11s600ms"_expect);
|
||||
CHECK (watch(bFlow).allEpochs() == "10s200ms|10s400ms|10s600ms|10s800ms|11s"_expect);
|
||||
CHECK (watch(bFlow).find(a2) == "10s600ms"_expect);
|
||||
|
||||
Time t0 = Time{0,5};
|
||||
|
||||
auto& a0 = bFlow.until(t0).create();
|
||||
CHECK (watch(bFlow).allEpochs() == "10s200ms|10s400ms|10s600ms|10s800ms|11s00ms"_expect);
|
||||
CHECK (watch(bFlow).allEpochs() == "10s200ms|10s400ms|10s600ms|10s800ms|11s"_expect);
|
||||
CHECK (watch(bFlow).find(a0) == "10s200ms"_expect);
|
||||
|
||||
BlockFlow::AllocatorHandle allocHandle = bFlow.until(Time{300,10});
|
||||
|
|
@ -261,14 +261,14 @@ namespace test {
|
|||
CHECK (not allocHandle.hasFreeSlot());
|
||||
auto& a6 = bFlow.until(Time{850,10}).create();
|
||||
CHECK (watch(bFlow).find(a6) == "11s150ms"_expect);
|
||||
CHECK (watch(bFlow).allEpochs() == "10s200ms|10s400ms|10s600ms|10s800ms|11s00ms|11s150ms"_expect);
|
||||
CHECK (watch(bFlow).allEpochs() == "10s200ms|10s400ms|10s600ms|10s800ms|11sms|11s150ms"_expect);
|
||||
|
||||
auto& a7 = bFlow.until(Time{500,11}).create();
|
||||
CHECK (watch(bFlow).find(a7) == "11s600ms"_expect);
|
||||
CHECK (watch(bFlow).allEpochs() == "10s200ms|10s400ms|10s600ms|10s800ms|11s00ms|11s150ms|11s300ms|11s450ms|11s600ms"_expect);
|
||||
CHECK (watch(bFlow).allEpochs() == "10s200ms|10s400ms|10s600ms|10s800ms|11sms|11s150ms|11s300ms|11s450ms|11s600ms"_expect);
|
||||
|
||||
bFlow.discardBefore (Time{999,10});
|
||||
CHECK (watch(bFlow).allEpochs() == "11s00ms|11s150ms|11s300ms|11s450ms|11s600ms"_expect);
|
||||
CHECK (watch(bFlow).allEpochs() == "11s|11s150ms|11s300ms|11s450ms|11s600ms"_expect);
|
||||
|
||||
auto& a8 = bFlow.until(Time{500,10}).create();
|
||||
CHECK (watch(bFlow).find(a8) == "11s150ms"_expect);
|
||||
|
|
|
|||
|
|
@ -78887,20 +78887,20 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1689199616791" ID="ID_752152349" MODIFIED="1689303038986" TEXT="placeActivity">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1689202512708" ID="ID_101278669" MODIFIED="1689303033032" TEXT="in leeren BlockFlow">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node COLOR="#338800" CREATED="1689202512708" ID="ID_101278669" MODIFIED="1689449425443" TEXT="in leeren BlockFlow">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1689202522354" ID="ID_523714574" MODIFIED="1689303033031" TEXT="für Vergangenheit">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node COLOR="#338800" CREATED="1689202522354" ID="ID_523714574" MODIFIED="1689449428380" TEXT="für Vergangenheit">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1689202560123" ID="ID_827332375" MODIFIED="1689303033031" TEXT="zu bestehenden Epochen">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689303110181" ID="ID_97036563" LINK="#ID_1494295782" MODIFIED="1689303132165" TEXT="brauche Diagnostic für die reale Epochen-Zuordnung">
|
||||
<node COLOR="#338800" CREATED="1689202560123" ID="ID_827332375" MODIFIED="1689449429802" TEXT="zu bestehenden Epochen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#435e98" CREATED="1689303110181" ID="ID_97036563" LINK="#ID_1494295782" MODIFIED="1689449431509" TEXT="brauche Diagnostic für die reale Epochen-Zuordnung">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1689202576227" ID="ID_1382030737" MODIFIED="1689303033031" TEXT="in die Zukunft">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node COLOR="#338800" CREATED="1689202576227" ID="ID_1382030737" MODIFIED="1689449434375" TEXT="in die Zukunft">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1689202597977" ID="ID_1853102157" MODIFIED="1689303033030" TEXT="Overflow zu nächster Epoche">
|
||||
<icon BUILTIN="pencil"/>
|
||||
|
|
@ -79995,8 +79995,8 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689210110811" ID="ID_1846164158" MODIFIED="1689210118699" TEXT="Einordnen nach Deadline">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689210215933" ID="ID_1683638890" MODIFIED="1689210239201" TEXT="suche frühest mögliche Epoch die diese Deadline unterstützt">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1689210215933" ID="ID_1683638890" MODIFIED="1689449352740" TEXT="suche frühest mögliche Epoch die diese Deadline unterstützt">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1689210281036" ID="ID_1680657401" MODIFIED="1689210292215" TEXT="Deadline der Epoche muß später sein">
|
||||
<icon BUILTIN="idea"/>
|
||||
</node>
|
||||
|
|
@ -80005,16 +80005,15 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node COLOR="#338800" CREATED="1689210431448" ID="ID_1334888981" MODIFIED="1689215569136" TEXT="leer ⟹ ein Epoch-Spacing dahinter">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689210490128" ID="ID_1250262060" MODIFIED="1689210496800" TEXT="<=>">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689210499415" ID="ID_786359649" MODIFIED="1689210559591" TEXT="vor erster ⟹ in erste">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#435e98" CREATED="1689210490128" ID="ID_1250262060" MODIFIED="1689446219559" TEXT="<=>">
|
||||
<node COLOR="#338800" CREATED="1689210499415" ID="ID_786359649" MODIFIED="1689446205366" TEXT="vor erster ⟹ in erste">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689210528987" ID="ID_1687889712" MODIFIED="1689210559591" TEXT="in Range ⟹ Suche">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1689210528987" ID="ID_1687889712" MODIFIED="1689446207767" TEXT="in Range ⟹ Suche">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689210541041" ID="ID_1514746633" MODIFIED="1689210559591" TEXT="nach letzter ⟹ Grid erweitern">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1689210541041" ID="ID_1514746633" MODIFIED="1689449349543" TEXT="nach letzter ⟹ Grid erweitern">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -80060,22 +80059,24 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1688555006558" ID="ID_11354677" MODIFIED="1688555057586" TEXT="Beschluß: KISS">
|
||||
<node COLOR="#435e98" CREATED="1688555006558" ID="ID_11354677" MODIFIED="1689449393293" TEXT="Beschluß: KISS">
|
||||
<icon BUILTIN="yes"/>
|
||||
<node CREATED="1688555021190" ID="ID_1624305559" MODIFIED="1688555026714" TEXT="keine logarithmische Suche"/>
|
||||
<node CREATED="1688555027213" ID="ID_1516151909" MODIFIED="1688555031529" TEXT="kein separater Index"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1688555032021" ID="ID_1157610750" MODIFIED="1688555050479" TEXT="die EpochGate als Linked-List verwenden">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#5b280f" CREATED="1688555032021" ID="ID_1157610750" MODIFIED="1689449365421" TEXT="die EpochGate als Linked-List verwenden">
|
||||
<icon BUILTIN="button_cancel"/>
|
||||
<node CREATED="1688778164204" ID="ID_1590074187" MODIFIED="1688778220458" TEXT="geht nicht mehr">
|
||||
<linktarget COLOR="#fe0d3a" DESTINATION="ID_1590074187" ENDARROW="Default" ENDINCLINATION="23;-55;" ID="Arrow_ID_708564411" SOURCE="ID_717553610" STARTARROW="None" STARTINCLINATION="-39;2;"/>
|
||||
<icon BUILTIN="closed"/>
|
||||
</node>
|
||||
<node CREATED="1688778276909" ID="ID_110193234" MODIFIED="1688778291547" TEXT="dann muß hier der Basis-Allokator helfen">
|
||||
<node CREATED="1688778276909" ID="ID_110193234" MODIFIED="1689449385009" TEXT="dann muß hier der Basis-Allokator helfen">
|
||||
<arrowlink COLOR="#4b84c8" DESTINATION="ID_462737656" ENDARROW="Default" ENDINCLINATION="92;7;" ID="Arrow_ID_1743819163" STARTARROW="None" STARTINCLINATION="-6;48;"/>
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689204144537" ID="ID_462737656" MODIFIED="1689204198471" TEXT="Epochen-Navigation per ExtentFamily">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1689204144537" ID="ID_462737656" MODIFIED="1689449390148" TEXT="Epochen-Navigation per ExtentFamily">
|
||||
<linktarget COLOR="#4b84c8" DESTINATION="ID_462737656" ENDARROW="Default" ENDINCLINATION="92;7;" ID="Arrow_ID_1743819163" SOURCE="ID_110193234" STARTARROW="None" STARTINCLINATION="-6;48;"/>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -80278,8 +80279,8 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689204604589" ID="ID_1478405779" MODIFIED="1689204610300" TEXT="Deadlines">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689204644343" ID="ID_1848987574" MODIFIED="1689204801974" TEXT="oldest"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689204650526" ID="ID_624484958" MODIFIED="1689204801974" TEXT="newest"/>
|
||||
<node COLOR="#435e98" CREATED="1689204644343" ID="ID_1848987574" MODIFIED="1689449409248" TEXT="oldest"/>
|
||||
<node COLOR="#435e98" CREATED="1689204650526" ID="ID_624484958" MODIFIED="1689449409248" TEXT="newest"/>
|
||||
<node COLOR="#435e98" CREATED="1689204731722" ID="ID_1494295782" MODIFIED="1689439593921" TEXT="Allokations-Zuordnung"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689204805041" ID="ID_1427200190" MODIFIED="1689204809545" TEXT="Ereignisse">
|
||||
|
|
@ -80295,15 +80296,6 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node COLOR="#338800" CREATED="1689204913954" ID="ID_256874849" MODIFIED="1689204922646" TEXT="für ExtentFamily">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689204923473" ID="ID_756310466" MODIFIED="1689204950523" TEXT="für BlockFlow">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1689439619197" ID="ID_1454011778" MODIFIED="1689439653881" TEXT="erste und letzte Epoche als Deadline">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1689439631356" ID="ID_801146515" MODIFIED="1689439653881" TEXT="Epoche finden, in die eine gegebene Activity alloziert wurde">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689204967974" ID="ID_284088835" MODIFIED="1689204977426" TEXT="ActivityDetector">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689204985122" ID="ID_1020676746" MODIFIED="1689204995475" TEXT="Rahmen schaffen">
|
||||
|
|
@ -80338,6 +80330,15 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689204923473" ID="ID_756310466" MODIFIED="1689204950523" TEXT="für BlockFlow">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1689439619197" ID="ID_1454011778" MODIFIED="1689439653881" TEXT="erste und letzte Epoche als Deadline">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1689439631356" ID="ID_801146515" MODIFIED="1689439653881" TEXT="Epoche finden, in die eine gegebene Activity alloziert wurde">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
|
|||
Loading…
Reference in a new issue