The job system
Status: Planned. Worker jobs, priority lanes, counters and parallel loops for mods. Nothing on this page is in the API yet; the names in the final API may differ.
What this will cover
The engine runs worldgen, meshing and other heavy work on a fiber job system with priority lanes. This page will document submitting mod jobs (on world snapshots, never live world state), waiting on counters, parallel loops, and how results come back to the tick.
What you can do today
- Split long work into steps with the scheduler (
cl_sched_run_server,clight::every, Luacl.spawn+cl.sleep_ticks) (Scheduler and jobs). - WebAssembly code is compiled ahead of time, so heavy maths in C or C++ is fast even on the tick.