No matching definitions.

ecs/hstage

src/ecs/hstage.tur

heterogeneous (cross-world) system scheduler.

Since: E2c sized-scheduler direction 2

defstruct

WorldSystem

(defstruct WorldSystem [])

a System bound to one world (world-id + boxed handle).

Since: direction 2

defn

make-world-system

(make-world-system)

bundle a (world-id, masks, run-fn, world) tuple.

Since: direction 2

defn

bind-system

(bind-system [sys : System world-id : int world : int] :)

lift a `System` into a `WorldSystem` bound to a

systhe System (carries masks + run-fn)
world-idwhich world this system targets (conflict key)
worldthe system's own boxed world handle (:int carrier)

Since: direction 2

defn

world-system-conflicts?

(world-system-conflicts? [a : WorldSystem b : WorldSystem] :)

true if two WorldSystems cannot run

Since: direction 2

defopaque

HStage

(HStage)

heap container for a list of WorldSystems, pre-grouped into

Since: direction 2

defn

hstage-new

(hstage-new :)

allocate an empty HStage.

Since: direction 2

defn

hstage-len

(hstage-len [s : HStage] :)

count of WorldSystems added.

Since: direction 2

defn

hstage-add!

(hstage-add! [s : HStage sys : WorldSystem] :)

append a WorldSystem. Invalidates the wave partition.

Since: direction 2

defn

hstage-n-waves

(hstage-n-waves [s : HStage] :)

count of waves, recomputing the partition if stale.

Since: direction 2

defn

hstage-run!

(hstage-run! [s : HStage] :)

run every WorldSystem, each against its bound world.

Since: direction 2

defn

hstage-free!

(hstage-free! [s : HStage] :)

release the HStage's backing arrays.

Since: direction 2

Internal definitions
hstage-task-- pthread-callable worker. Reads {fn, world} from arg and
__hstage-recompute-waves-- internal: greedy first-fit grouping with
__hstage-run-wave-raw-- dispatch the systems in `wave-idx`
__hstage-dirty?-- internal: is the wave partition stale?