mirror of
https://github.com/pithings/unkernel.git
synced 2026-12-02 03:49:47 +08:00
js/web/cpu.ts is the browser Platform.spawnCpu: each CPU is a module Web Worker running runCpu(), nested in worker mode's kernel worker. webCpuBlocker() (Platform.whyNoCpus) gives the kernel one CPU where a thread cannot run CPUs: no cross-origin isolation, no Worker, no Atomics.waitAsync, or a page's main thread, where CPU 0's memory.atomic.wait32 would trap. stats().cpus says how many CPUs the kernel got. The dist inlines the CPU worker as a Blob URL, in the web entry and inside the web kernel worker.