After fork() on Linux, how are the parent’s memory pages normally handled?
Correct answer A. They are shared copy-on-write, so a page is copied only when either process writes to it
Linux implements fork() with copy-on-write: parent and child share the same physical pages marked read-only, and a private copy is made only when one of them writes. Since many children call exec soon after fork, this avoids copying memory that would be thrown away. The only real cost of fork() is duplicating page tables and creating the task structure.
Answer checked How we write and check questions
Discussion