"copy on write"

Written By Atticus Kuhn
Tags: "public", "operatingsystems", "project"
:PROPERTIES: :ID: 1de48b5e-d8c5-49e1-aa24-13ceed573b8f :mtime: 20240314094719 20240308081100 :ctime: 20240308081058 :END: #+title: copy on write #+filetags: :public:operatingsystems:project: * Copy-on-Write ** Example: Fork on Unix Recall that the [[id:221716ee-aa9e-43c2-ad1a-de3e6e246064][fork]]() system call creates a [[id:7405eae1-0686-41c0-a87d-7c402d98e018][child process]] that is a duplicate of its parent. Traditionally, fork() worked by creating a copy of the parent’s address space for the child, duplicating the pages belonging to the parent. However, considering that many child processes invoke the exec() system call immediately after creation, the copying of the parent’s address space may be unnecessary. ** Definition of COW Instead, we can use a technique known as copy-on-write, which works by allowing the [[id:9903fd7a-39b0-47c9-adeb-7f98cdefa4d5][parent]] and [[id:7405eae1-0686-41c0-a87d-7c402d98e018][child]] processes initially to share the same pages. These shared pages are marked as copy-on-write pages, meaning that if either process writes to a shared page, a copy of the shared page is created.

See Also

Operating Systems Coursefork (Unix)child processParent processchild process

Leave your Feedback in the Comments Section