What is Copy-On-Write (CoW)?

Copy-On-Write is when you share something, and only change it when needed, like sharing a toy without arguing over who gets to play with it first.

Imagine you and your friend both have the same lunchbox at school. At first, it's the same lunchbox, same snacks, same everything. But when one of you wants to add a cookie to their lunchbox, instead of changing the whole lunchbox for everyone, they just make a copy of it and then add the cookie. That way, the other person still has the original lunchbox with all the snacks as they were.

How It Works

  • Sharing: You both start with the same thing, like the same lunchbox.
  • Copying Only When Needed: If one person wants to change their copy, a new one is made just for them. The others still have the old one.
  • Saving Time and Space: This means you don’t waste time or space changing things everyone else uses.

It’s like having a shared drawing on paper, if someone wants to color it differently, they make a new copy of the paper instead of changing the whole thing for everyone. Copy-On-Write is when you share something, and only change it when needed, like sharing a toy without arguing over who gets to play with it first.

Imagine you and your friend both have the same lunchbox at school. At first, it's the same lunchbox, same snacks, same everything. But when one of you wants to add a cookie to their lunchbox, instead of changing the whole lunchbox for everyone, they just make a copy of it and then add the cookie. That way, the other person still has the original lunchbox with all the snacks as they were.

How It Works

  • Sharing: You both start with the same thing, like the same lunchbox.
  • Copying Only When Needed: If one person wants to change their copy, a new one is made just for them. The others still have the old one.
  • Saving Time and Space: This means you don’t waste time or space changing things everyone else uses.

It’s like having a shared drawing on paper, if someone wants to color it differently, they make a new copy of the paper instead of changing the whole thing for everyone.

Take the quiz →

Examples

  1. A copy-on-write system is like sharing a pizza, you only make a copy when you need to change your slice.
  2. Imagine copying a book, but only writing the new parts when needed instead of rewriting everything.
  3. If everyone in class gets the same textbook, and only one person changes their copy, that's copy-on-write.

Ask a question

See also

Discussion

Recent activity