Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
CopyOnWrite
Edit
PageHistory
Diff
Info
LikePages
You are viewing an old revision of this page.
View the current version
.
When you fork(2), or otherwise share some memory it takes a lot of time to copy the memory causing latency, and potentially wasting memory that could be shared. The idea of CopyOnWrite is to use the [MMU] to mark a region of memory readonly, when something attempts to write to this memory it causes a processor exception to be generated, this exception then copies this page (usually 4k on Intel). In particular after fork(2), it's very common to execve(2), throwing away all the memory that would have been copied.
2 pages link to
CopyOnWrite
:
CompilingHowto
PageFault