0
0
Operating Systemsknowledge~5 mins

Copy-on-write technique in Operating Systems - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AWhen a process writes to the shared data
BWhen the data is deleted
CWhen the system boots
DWhen a process reads the data
During a fork, how does Copy-on-write help?
AIt duplicates all memory immediately
BIt deletes the parent's memory
CIt shares memory pages until a write occurs
DIt prevents the child from accessing memory
What kind of page is used to mark shared memory in Copy-on-write?
ARead-only page
BWritable page
CExecutable page
DHidden page
Which of these is NOT a benefit of Copy-on-write?
AImproved performance
BImmediate data duplication
CMemory savings
DReduced unnecessary copying
Copy-on-write is commonly used in which of the following?
AProcess memory management
BFile systems
CData structures
DAll of the above
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.