Hacker News new | past | comments | ask | show | jobs | submit login

On the contrary, fork() has scalability trouble as memory grows. Even with copy on write, copying page tables is still O(1) with respect to address space (granted, with a significant divisor). This overhead becomes apparent as programs grow to gigabyte size -- a fork which before took microseconds can begin to take milliseconds. Forking is slow in many situations.

The issue described above can be avoided by using posix_spawn(3), which on linux uses vfork(2).




Do you mean O(n)?


Sorry, yes. That's what I get for posting before coffee :)

The cost of fork() is linear with respect to memory size.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: