Definitions

How computers for agents work, from the hardware to the sandbox.

Definitionsc

Copy-on-write

Copy-on-write is a way of sharing data between copies until one of them writes to it, at which point only the changed piece is copied.

Copy-on-write is a technique for making copies of data without duplicating the data up front. A new copy starts as a set of references to the original rather than a second set of bytes. When either side changes a piece, only that piece is copied, and the writer gets its own version. Everything that neither side has changed stays shared.

Copy-on-write exists because many copies are made and then barely changed. A forked process often replaces itself with a new program right away. A new disk often differs from its image by only a few files. Copying everything up front would waste time and space on data that never changes. Copy-on-write makes a copy almost free to create and charges only for the writes.

The idea appears at many layers, from memory pages in the kernel to file systems and block storage. Its cost moves from the moment of copying to the first write of each piece, which then takes longer. Sandboxes depend on it to start quickly from a shared image and to make snapshots cheap. Many sandboxes on one host can share one copy of their image, and each keeps only its own changes.