Copy-on-write: Difference between revisions

Content deleted Content added
Undid revision 1089088590 by Comp.arch (talk): Pointless edit, and contrary to the norm.
m No this part is not pointless, as it's the target article, not the redirect (seemingly was renamed). Wikipedia prefers lower case, it's not clear if it applies to (invisible) links too, but not disallowed.
Line 24:
COW is also used in [[Library (computer science)|library]], [[Application software|application]] and [[System software|system]] code.
 
In [[Multithreading (computer architecture)|multithreaded]] systems, COW can be implemented without the use of traditional [[Lock (softwarecomputer engineeringscience)|locking]] and instead use [[compare-and-swap]] to increment or decrement the internal reference counter. Since the original resource will never be altered, it can safely be copied by multiple threads (after the reference count was increased) without the need of performance-expensive locking such as [[Lock (computer science)|mutexes]]. If the reference counter turns 0, then by definition only 1 thread was holding a reference so the resource can safely be de-allocated from memory, again without the use of performance-expensive locking mechanisms. The benefit of not having to copy the resource (and the resulting performance gain over traditional deep-copying) will therefore be valid in both single- and multithreaded systems.
 
===Examples===
Line 53:
* [[Btrfs]]
* [[Demand paging]]
* [[Dirty COW]] – Aa computer security vulnerability for the [[Linux kernel]]
* [[Flyweight pattern]]
* [[Memory management]]