lumiera_/tests/vault/gear
Ichthyostega b497980522 Scheduler-test: guard memory allocations by grooming-token
Turns out that we need to implemented fine grained and explicit handling logic
to ensure that Activity planning only ever happens protected by the Grooming-Token.
This is in accordance to the original design, which dictates that all management tasks
must be done in »management mode«, which can only be entered by a single thread at a time.
The underlying assumption is that the effort for management work is dwarfed in comparison
to any media calculation work.

However, in
5c6354882d
...I discovered an insidious border condition, an in an attempt to fix it,
I broke that fundamental assumpton. The problem arises from the fact that we
do want to expose a *public API* of the Scheduler. Even while this is only used
to ''seed'' a calculation stream, because any further planning- and management work
will be performed by the workers themselves (this is a design decision, we do not
employ a "scheduler thread")
Anyway, since the Scheduler API ''is'' public, ''someone from the outside'' could
invoke those functions, and — unaware of any Scheduler internals — will
automatically acquire the Grooming-Token, yet never release it,
leading to deadlock.

So we need a dedicated solution, which is hereby implemented as a
scoped guard: in the standard case, the caller is a management-job and
thus already holds the token (and nothing must be done). But in the
rare case of an »outsider«, this guard now ''transparently'' acquires
the token (possibly with a blocking wait) and ''drops it when leaving scope''
2023-12-19 23:38:57 +01:00
..
activity-detector-test.cpp Scheduler-test: rework handling of notifications in the Activity-Language 2023-12-16 23:47:50 +01:00
activity-detector.hpp Scheduler-test: rework handling of notifications in the Activity-Language 2023-12-16 23:47:50 +01:00
block-flow-test.cpp Scheduler: connect BlockFlow capacity announcement 2023-11-10 23:52:20 +01:00
scheduler-activity-test.cpp Scheduler-test: rework handling of notifications in the Activity-Language 2023-12-16 23:47:50 +01:00
scheduler-commutator-test.cpp Scheduler-test: guard memory allocations by grooming-token 2023-12-19 23:38:57 +01:00
scheduler-invocation-test.cpp Scheduler: reconciled into clearer design 2023-11-04 04:49:13 +01:00
scheduler-load-control-test.cpp Scheduler: connect BlockFlow capacity announcement 2023-11-10 23:52:20 +01:00
scheduler-service-test.cpp Scheduler-test: Integration-test now running smoothly 2023-12-18 23:34:10 +01:00
scheduler-stress-test.cpp Scheduler-test: planning for stress-tests 2023-12-19 21:06:23 +01:00
scheduler-usage-test.cpp Scheduler: plan for integration 2023-10-20 00:59:50 +02:00
special-job-fun-test.cpp Scheduler-test: a helper for one-time operations 2023-12-08 03:16:57 +01:00
test-chain-load-test.cpp Scheduler-test: Integration-test now running smoothly 2023-12-18 23:34:10 +01:00
test-chain-load.hpp Scheduler-test: retract support for ''self-inhibition'' 2023-12-19 21:07:33 +01:00
work-force-test.cpp Chain-Load: demonstrate use of the expansion rule 2023-11-29 02:58:55 +01:00