4 ms·
Even if VM overcommit is enabled, you shouldn't be forking from large processes, because the necessary kernel VM manipulation will kill your performance.
by cperciva 12y ago
Even if VM overcommit is enabled, you shouldn't be forking from large processes, because the necessary kernel VM manipulation will kill your performance.
- quotemstr 12y agoYep. For that problem, there's vfork.
- cperciva 12y agoWhich is great, albeit easy to use wrong; but it's not portable, unfortunately.
- quotemstr 12y agoIt's portable enough: Linux, Darwin, and the BSDs all support it. Darwin also supports posix_spawn natively. Even Cygwin supports it, although Cygwin's vfork is currently just an alias for fork.
- girvo 12y agoI seem to remember Cygwin having all sorts of weird problems with fork behaviour, but I'm no C programmer let alone doing stuff on Windows, so I might be remembering incorrectly