| ▲ | amluto an hour ago | |||||||||||||
I have the entirely opposite opinion. IMO a big mistake of the UNIXy model is that so much state is preserved across the creation of a process. For example, there are APIs to have a specific thing be fd number 4 so you can run a program and have it find that thing at fd 4. This is weird. 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. | ||||||||||||||
| ▲ | chasil 3 minutes ago | parent | next [-] | |||||||||||||
Well, Cygwin and Busybox have shown me that fork-heavy activities are about 100x slower on Windows than Linux. The Windows approach may be correct, but it suffers in performance from the POSIX perspective. I have heard that WSL1 iimproves this. | ||||||||||||||
| ▲ | __david__ 26 minutes ago | parent | prev | next [-] | |||||||||||||
Having fd 4 mean something specific is no weirder than having fds 0,1, and 2 mean something specific, which is probably never going to change. At some point you just gotta embrace the Unix. | ||||||||||||||
| ▲ | 1718627440 an hour ago | parent | prev | next [-] | |||||||||||||
Is it weirder, that you can pass an variable precisely into argument 4? You do need to pass information to a subprocess and there needs to be some agreement on what means what. Sure, maybe you could use names instead of fds, but that sounds needlessly complicated. | ||||||||||||||
| ||||||||||||||
| ▲ | burnt-resistor an hour ago | parent | prev [-] | |||||||||||||
You're simply failing to grasp the value of the simplicity, compatibility, and portability of POSIX/*nix. Inventing yet another way to create a process would be complex and break things. It's a-la-carte to enable configuration after fork of the new CoW or non-CoW process but before exec (unless vfork or similar were used). This is the model. 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. | ||||||||||||||
| ||||||||||||||