Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M6279

Copy-on-Write, COW

Copy-on-Write, COW
BusinessHigh supportManagement
Included
account_tree

Updated 2026-07-28

Loading revision record…

Summary

Copy-on-write (COW) is an optimization strategy in computer programming. Its core idea is that if multiple callers simultaneously request the same resource (such as memory or disk data storage), they all get the same pointer to the same resource until one caller attempts to modify the content, at which point the system actually clones a private copy for that caller, while other callers still see the original resource unchanged.

Definition

Copy-on-write (COW) is an optimization strategy in computer programming. Its core idea is that if multiple callers simultaneously request the same resource (such as memory or disk data storage), they all get the same pointer to the same resource until one caller attempts to modify the content, at which point the system actually clones a private copy for that caller, while other callers still see the original resource unchanged. This process is transparent to other callers. The main advantage is that if no caller modifies the resource, no private copy is created, so multiple callers can share the same resource for read-only operations.

How to use

Copy-on-write (COW) is an optimization strategy in computer programming. Its core idea is that if multiple callers simultaneously request the same resource (such as memory or disk data storage), they all get the same pointer to the same resource until one caller attempts to modify the content, at which point the system actually clones a private copy for that caller, while other callers still see the original resource unchanged.

Mechanism

When creating a copy, do not immediately copy the resource; instead, share it. Only when a party attempts to modify does it actually copy (write-time split). The mechanism is "delayed separation" — maximize resource utilization through sharing, and only incur the copy cost when a real fork occurs.

Practice

In progress 0/4

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%

Cases

  • Process fork shares memory pages; Docker image layers share read-only layers; new hires/new businesses share backend in early stages.

Common pitfalls

  • Premature copying causes resource waste; or a party's accidental write during the shared period leads to unintended copying/contamination.
Sources

Source support: Explicit

References currently contain only Wikipedia links; primary sources still need review.

  • link
    zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E5%AF%AB%E5%85%A5%E6%99%82%E8%A4%87%E8%A3%BDZH · Explicit
    verified
account_treeGenealogyexpand_more

RELATED MODELS