Recall & Review
beginner
What is the Copy-on-write (COW) technique?
Copy-on-write is a memory management technique where multiple processes share the same resource (like memory) until one process modifies it. At that point, a copy is made for the modifying process, avoiding unnecessary duplication.
Click to reveal answer
beginner
Why is Copy-on-write useful in operating systems?
It saves memory and improves performance by delaying copying until it is necessary, such as when a process writes to shared data.
Click to reveal answer
intermediate
How does Copy-on-write work during process creation?
When a new process is created (like with fork), it shares the parent's memory pages marked as read-only. Only when the child or parent writes to a page, a copy is made for that process.
Click to reveal answer
intermediate
What happens if a process tries to write to a shared page in Copy-on-write?
The operating system detects the write attempt on a read-only shared page, creates a private copy of that page for the writing process, and then allows the write.
Click to reveal answer
advanced
Name a common use case of Copy-on-write outside process memory management.
Copy-on-write is also used in file systems and data structures to efficiently manage copies without duplicating data until changes occur.
Click to reveal answer
What triggers the actual copying of data in Copy-on-write?
✗ Incorrect
Copying happens only when a process writes to the shared data, not when it reads.
During a fork, how does Copy-on-write help?
✗ Incorrect
Copy-on-write allows the child and parent to share memory pages until one writes, saving memory.
What kind of page is used to mark shared memory in Copy-on-write?
✗ Incorrect
Shared pages are marked read-only to detect writes and trigger copying.
Which of these is NOT a benefit of Copy-on-write?
✗ Incorrect
Copy-on-write delays copying; immediate duplication is not a benefit.
Copy-on-write is commonly used in which of the following?
✗ Incorrect
Copy-on-write is used in process memory, file systems, and data structures to optimize resource use.
Explain how Copy-on-write works when a process tries to modify shared memory.
Think about what happens when a process writes to memory shared with another.
You got /4 concepts.
Describe the advantages of using Copy-on-write in operating systems.
Consider why delaying copying can be helpful.
You got /4 concepts.