Notes
- Tasks use
setjmp/longjmpfor stack-based coroutines (not KOS threads). Zero context switch overhead. - Async I/O creates a KOS
thd_workerinternally — disc reads happen on a real thread, completion is polled by the scheduler. - Frame budget prevents tasks from starving the render loop. Measured
via
perf_cntr_timer_ns(). - 16 concurrent tasks is generous. Typical: disc streamer + AI ticker + scene loader = 3.
Spec 7: Asset Manager
(shachi/asset_mgr.h)
Problem
DC has 16MB main RAM + 8MB VRAM. Every texture, mesh, and sound must be tracked. When a scene unloads, its assets must be freed. When assets are shared across scenes, they must be ref-counted.