Apex › Systems & OS

Copy-on-write fork

Why fork() is cheap even for a process using gigabytes. Instead of copying memory up front, the child shares the parent's pages read-only; only a write to a shared page faults and copies that one page. Fork, then write pages and watch them diverge — or exec the child and watch nothing get copied at all.

More in Systems & OS