Jump to a problem, path or page
01 · Frame the problem
Design an in-process executor for a finite directed acyclic task graph. Tasks may fail, dependants must not run prematurely and duplicate completion callbacks must not release a dependency twice.
Dependencies define when a task becomes eligible, while concurrency limits define when eligible work starts. Analyse cycles, repeated completion, failure propagation and cancellation before dispatching any user callbacks.
02 · Find the design pressure
Begin with validated graph indegrees and a ready queue. Starting tasks during validation can produce partial execution before discovering a cycle. Apply each terminal transition once and execute callbacks outside the scheduler's shared-state boundary.
03 · Define success
04 · Identify the correctness boundary
Reject cycles before executing any task. Maintain remaining-dependency counts and terminal state transitions under one scheduler boundary, while user work runs outside it. A task becoming terminal twice must not decrement children twice, and failed prerequisites need explicit skip/continue behavior.
05 · Make it concrete
A and B both precede C. A completes twice through duplicate callbacks; C remains blocked until B completes because A's terminal transition is applied once. If B fails under fail-fast policy, C is skipped rather than scheduled with incomplete prerequisites, and started tasks still receive tracked completion handling.
Jump to a problem, path or page