Skip to content

Runtime and concurrency model

dkjs runs the build on the Node.js event loop, which plays exactly the role of dk0's single engine thread and dk1's engine thread: every scheduler continuation and every build-state and trace-store mutation happens there, in the same order dk0 would choose. The only concurrency is external-process leaves - each child_process.spawn and the wait for it to exit - admitted up to the -j cap and applied back on the event loop in a deterministic order. No native threads are used.