PTE · Reading · easy
Read the text and answer the question by selecting all the correct responses. More than one response is correct.
In modern operating systems, efficient process creation relies heavily on a resource-management mechanism known as copy-on-write, commonly abbreviated as COW. When a parent process executes a system call to duplicate itself, a naive approach would require the operating system to immediately replicate all physical memory pages allocated to that process. Because many processes invoke an entirely new program immediately after spawning, duplicating gigabytes of address space creates unnecessary processing overhead and exhausts physical random access memory. Under the copy-on-write protocol, the operating system bypasses initial duplication. Instead, it assigns the child process page tables that point directly to the identical physical memory frames occupied by the parent. To protect system integrity, the memory management unit marks all these shared memory pages as read-only, regardless of their prior access permissions. Both processes can read from these shared frames simultaneously without conflict. The duplication mechanism is deferred until either the parent or the child attempts to perform a write operation on a shared page. When a write attempt occurs, the processor hardware detects a protection fault and raises a trap to the operating kernel. The operating system intercepts this interrupt, allocates a fresh, single physical frame of memory, copies the contents of the target page into it, and updates the faulting process's page table to point to the new frame. Only the writing process receives the private duplicate, allowing the unmodified process to retain access to the original page.
According to the passage, which of the following statements correctly describe the copy-on-write process?
- The child process initially receives an entirely separate physical duplicate of every memory page.
- Pages allocated under copy-on-write are immediately marked with unrestricted write permissions.
- Shared memory frames can only be accessed by one process at any given moment.
- A dedicated physical frame is allocated only when a process attempts to modify a page.
- The kernel duplicates memory before any hardware protection trap is generated.
- Page tables of newly spawned processes reference the physical frames used by the parent.
- Both processes are forcibly terminated whenever a memory protection fault is detected.