What is "copy-on-write" (COW) in the context of the "fork()" system call, and why is it important for performance?
Correct! Well done.
Incorrect.
The correct answer is A) When fork() is called, the child initially shares the parent's physical memory pages, marked read-only; only when either process writes to a shared page does the kernel copy it, deferring or avoiding the cost of duplicating the address space
Correct Answer
When fork() is called, the child initially shares the parent's physical memory pages, marked read-only; only when either process writes to a shared page does the kernel copy it, deferring or avoiding the cost of duplicating the address space
COW makes fork() efficient: since many forked processes immediately call exec() (replacing their memory entirely) or only read from inherited memory, avoiding an eager full copy of the parent's address space saves significant time and memory in the common case.