3 ms·
> With Cosmopolitan Libc, 20 spawns per second is about the speed I get when simulating fork() on Windows. Egads, this reminds me of when I used to muck with C
by amluto 2y ago
> With Cosmopolitan Libc, 20 spawns per second is about the speed I get when simulating fork() on Windows.
Egads, this reminds me of when I used to muck with Cygwin. fork() is quite a complex bit of kernel magic, and that’s on kernels designed for it. Simulating fork() on Windows well enough to be usable has always struck me as quite impressive.
But it’s also ridiculous. Forking to spawn a process is an almost comically poor design, and this is one of maybe two things IMO that Windows got right! CreateProcess() may be ugly, its arguments may involve nasty data structures, the command line string may be a disaster that continues to cause problems to this day, but it’s a far superior design for spawning processes. I hope that no one who cares even slightly about process spawning performance on Windows tries to do it using fork.
Not that Windows has ever been particularly fast at spawning processes…