Code on a screen, representing copy-on-write.

Sharing data until someone needs to change it.

What copy-on-write is

Copy-on-write is a technique for managing resources efficiently. The idea is that when multiple parties need what appears to be their own copy of some data, they can actually share a single copy, as long as none of them changes it. Only when one of them needs to modify the data is a separate copy made for that party. This avoids copying data that is never changed.

Sharing until a change

The heart of copy-on-write is that identical data does not need to be duplicated until there is a reason to. If several users of the data only read it, they can all safely share the same underlying copy. The expense of making a private copy is deferred - delayed - until the moment someone actually writes to the data. Up to that point, sharing is both safe and efficient.

Making a copy on demand

When one of the sharers does need to modify the data, the technique steps in to create a copy just for that party, so its changes do not affect the others. This is where the name comes from: the copy is made on the write, at the point of modification. The other parties continue to share the original, unchanged data, unaffected by the modification.

Why it is efficient

Copy-on-write is efficient because it avoids unnecessary copying. In many situations, data that is shared is never actually changed, so making separate copies up front would waste both time and memory. By sharing first and copying only when needed, the system does the minimum work required. When changes are rare, the savings can be significant, which is why the technique is widely used.

Where copy-on-write appears

Copy-on-write appears in several areas of computing, including how operating systems manage memory and how some data structures and storage systems work. Wherever it is beneficial to let multiple users share data that might not change, the technique can help. Its presence in many systems reflects how valuable it is to defer copying until the moment it genuinely becomes necessary.

Why it matters

Copy-on-write is an important efficiency technique in computing. Understanding what it is - sharing data until someone needs to change it, then copying - clarifies a clever way systems save time and memory. For anyone interested in how operating systems and software manage resources efficiently, it is a valuable concept to understand.

See also: What is virtual memory? Explained, What is memory management? Explained.

Sources

Published date reflects the original event date (2025-03-18). This article is original Skillo editorial written from the sources above; facts were verified in September 2026.

Skillo Staff

Skillo Staff

All stories by: Skillo Staff

Leave a Reply