337 points by jwilk 1 day ago | 323 comments | View on ycombinator
rom1v 1 day ago |
sanderjd 1 day ago |
mrkeen 1 day ago |
It's weird to leave out a mention of copy-on-write - the optimisation that means that you don't copy over all the memory.
uecker 1 day ago |
jcalvinowens 1 day ago |
Yes, it's copy on write... but there is a linear relationship between the size of the process and the number of page table entries required to represent it.
ajkjk 1 day ago |
I am curious about what the best way to handle the example in the article of one process spawning many git subprocesses is. Surely it just doesn't make sense to repeatedly start git from scratch in the course of a long-running parent operation. What's the low cost abstraction for the same result, though?
mpweiher about 9 hours ago |
- address space
- memory objects
- threads
Mix and match. A Task (process) is not a primitive, but a composite object combining address space with one or more threads. How you fill the address space with actual memory objects is up to you. Map from disk or COW your own address space...have fun!
https://developer.apple.com/library/archive/documentation/Da...
Panzerschrek 1 day ago |
ktpsns 1 day ago |
medoc about 5 hours ago |
ComputerGuru 1 day ago |
codedokode about 24 hours ago |
My idea is that we could make a new syscall, for example "spawn", that creates a new empty process, loads some lightweight "loader" into it, and passes arbitrary configuration data. The loader configures the process and exec()'s the main program. This allows to avoid forking the memory and keep existing APIs, but still requires to fork file descriptors and other things.
trumpdong about 23 hours ago |
tus666 about 7 hours ago |
asveikau about 24 hours ago |
If you contrast that with win32, where you optionally pack a bunch of initial values into a struct, win32 is a much more narrow, less pleasant, less freeform interface, where it is harder to introduce more features.
But I think there is already posix_spawn to imitate that philosophy on Unix-like OSs.
high_byte about 1 hour ago |
lokar 1 day ago |
foo-bar-baz529 about 14 hours ago |
debatem1 1 day ago |
mike_hock 1 day ago |
I.e. a year that starts with 20, not 19.
Sophira 1 day ago |
ggm 1 day ago |
I do use threaded code. It's significantly harder to write and reason about. (45 years in to a CS career, ageing out)
You have to be clever to do better than clever people. Clever people bootstrapped me into fork()/exec() and I know my limits.
stevefan1999 about 19 hours ago |
a-dub 1 day ago |
undefined 1 day ago |
LoganDark about 18 hours ago |
burnt-resistor 1 day ago |
Every couple of years, someone claims they have "the solution" implying everyone else who came before them didn't know what they were doing.
sathyayoshi about 10 hours ago |
hparadiz 1 day ago |
I mean maybe this has been optimized for already and I don't know what I'm talking about but maybe someone with more knowledge about the kernel knows? Is this something we simply can't optimize for because of security implications?
> ABSTRACT
> The received wisdom suggests that Unix’s unusual combination of fork() and exec() for process creation was an inspired design. In this paper, we argue that fork was a clever hack for machines and programs of the 1970s that has long outlived its usefulness and is now a liability. We catalog the ways in which fork is a terrible abstraction for the modern programmer to use, describe how it compromises OS implementations, and propose alternatives.
> As the designers and implementers of operating systems, we should acknowledge that fork’s continued existence as a first-class OS primitive holds back systems research, and deprecate it. As educators, we should teach fork as a historical artifact, and not the first process creation mechanism students encounter.