4 ms·
Can anybody elucidate about why fork() is still used in Chromium or Node.js? They are not old-grown traditional forking Unix servers (unlike Apache or the menti
by ktpsns 8y ago
Can anybody elucidate about why fork() is still used in Chromium or Node.js? They are not old-grown traditional forking Unix servers (unlike Apache or the mentioned databases in the paper). I would expect them to implement some of the alternatives and having fork() only as a fallback in the code (i.e. after a cascade of #ifdefs) if no other API is available. Therefore, I wonder where the fork() bottlenecks really appear in everyday's life.
- xyzzyz 8y ago> why fork() is still used in Chromium To support a multi-process web browser architecture that Chromium pioneered, you need to spawn processes. See https://chromium.googlesource.com/chromium/src/+/HEAD/docs/linux_zygote.md https://chromium.googlesource.com/chromium/src/+/HEAD/docs/l...
- Dylan16807 8y agoThat's not what the page says. It says the use of fork() saves 8MB and a few tens of milliseconds per process spawn.
- evmar 8y agoChrome on Windows uses CreateProcess, and Windows came first, so Chrome is mostly architected around an approach that would fit posix_spawn better. However, fork has some benefits that I went into here: http://neugierig.org/software/chromium/notes/2011/08/zygote.html http://neugierig.org/software/chromium/notes/2011/08/zygote....
- IshKebab 8y agoThis is explained in the paper. It's to get access to copy-on-write memory so you can make a pre-initialised process cheaply.