4 ms·
How does Solaris handle this? Or Darwin?
by pjc50 5y ago
How does Solaris handle this? Or Darwin?
- wahern 5y agoSolaris has strict memory accounting; fork will fail if the system can't guarantee space for all non-shared anonymous memory. macOS has overcommit (all BSDs do to some extent, at least for fork), but it also automatically creates swap space so you rarely encounter issues one way or another in practice. fork and malloc can also fail in Linux even with overcommit enabled (rlimits, but also OOM killer racing with I/O page dirtying triggering best-effort timeout), so Linux buys you a little convenience at the cost of making it impossibly difficult to actually guarantee behavior when it matters most.
- scottlamb 5y agoI don't use Solaris, but I see they have vfork [1] which should be unaffected. Likewise posix_spawn{,p}. (I think those are often implemented in userspace via vfork; unsure if there's a separate system call on Solaris.) [1] https://docs.oracle.com/cd/E26505_01/html/816-5167/vfork-2.html https://docs.oracle.com/cd/E26505_01/html/816-5167/vfork-2.h...