ecs/stage
src/ecs/stage.tur
sequential and parallel system schedulers.
Since: E2
defn
stage-run-seq
(stage-run-seq [a : System b : System w : int] :)
run System `a` then System `b` sequentially.
Since: E2
defn
stage-run-pair-parallel
(stage-run-pair-parallel)
run two non-conflicting Systems in
Since: E2
defopaque
Stage
(Stage)
opaque container for a list of Systems, pre-grouped into
Since: E2
defn
stage-new
(stage-new :)
allocate an empty Stage.
Since: E2
defn
stage-len
(stage-len [s : Stage] :)
count of Systems added to the Stage.
Since: E2
defn
stage-add!
(stage-add! [s : Stage sys : System] :)
append a System to the Stage. The Stage's wave
Since: E2
defn
stage-n-waves
(stage-n-waves [s : Stage] :)
count of waves the Stage has been partitioned into.
Since: E2
defn
stage-run!
(stage-run! [s : Stage w : int] :)
run every System in the Stage. Waves run sequentially;
Since: E2
defn
stage-free!
(stage-free! [s : Stage] :)
release the Stage's backing arrays.
Since: E2
Internal definitions
stage-pair-task-- pthread-callable worker. Reads {fn,world} fromstage-pair-parallel-raw-- spawn one OS thread to run `a-fn` and__stage-recompute-waves-- internal: greedy first-fit grouping.__stage-run-wave-raw-- dispatch the systems whose `waves[i] ==__stage-dirty?-- internal: is the wave partition stale?