Windows, for all its many, many faults, did not use fork+exec and instead mostly has options for how one creates a process. It wasn’t done elegantly, but it was the right decision.
Windows, for all its many, many faults, did not use fork+exec and instead mostly has options for how one creates a process. It wasn’t done elegantly, but it was the right decision.
Any kind of replacement should aim for the same conceptual simplicity and power. Sadly, I fear that people driving development nowadays are more interested in building unbreakable walled gardens for advertisement or app stores, or trying to squeeze down the some small gain when used on the cloud. I am more interested in general computing on the user side.
I dunno, that's the best I can do for now. Maybe you can do better?
Pipes and redirections don’t need fork + exec. Neither do subshells.
Possibly the most common way to tell the child the value is by setting it as a CLI arg in CreateProcess.
How do you selectively pass on fds without having a global impact on your process?
There have been plenty of comments here about effective workarounds, multi-process architectures to keep fork cheap, zygotes... these are very specifically working around the problem, while trying to avoid admitting it's a problem.
It's an achievable result with less specialised parts, but there's a reason we don't write all of our logic in NAND gates.
I'm still only inferring what you meant by CreateProcess needing special facilities; I assume you meant opt-in fd inheritance. Saving a parameter call while forcing all fds to be shared/duplicated seems penny-wise but pound-foolish.
* https://jdebp.uk/FGA/bernstein-on-ttys/cttys.html
Interestingly, on MS/PC/DR-DOS file descriptor 3 was stdaux. and file descriptor 4 was stdprn.
The Windows approach may be correct, but it suffers in performance from the POSIX perspective.
I have heard that WSL1 iimproves this.
Windows does not historically depend on fork(), so there was no native fork(), so Cygwin kludged it up.
Though actually iirc werfault uses NtCreateUserProcess() to clone processes when writing out crash dumps to this day
If you want to greenfield re-engineer the world with all new system calls and a totally different execution model, feel free to go right ahead.
― George Bernard Shaw, probably.