logoalt Hacker News

nvme0n1p1today at 5:22 PM2 repliesview on HN

We don't have any broadly used non-fork samples. Windows, macOS, and Linux all have fork. So the presence of fork can't be the reason for the performance difference.

(Windows's fork is called ZwCreateProcess)


Replies

dcrazytoday at 5:37 PM

NtCreateProcess does not implement a forking model. It is analogous to posix_spawn.

show 1 reply
Someonetoday at 6:38 PM

MacOS has posix_spawn. See https://developer.apple.com/library/archive/documentation/Sy... (yes, that’s an iOS man page. MacOS has the call, too, but I couldn’t find the man page online and it looks identical to me)

I don’t know how they implemented it, though. Under the hood, it could do the equivalent of a fork/exec pair.

show 2 replies