Read–modify–write

From Wikipedia, the free encyclopedia
Revision as of 06:55, 23 March 2025 by 216.58.25.209 (talk) (Consensus number: fix duplication using {{excerpt}})
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Short description Script error: No such module "redirect hatnote". In computer science, read–modify–write is a class of atomic operations (such as test-and-set, fetch-and-add, and compare-and-swap) that both read a memory location and write a new value into it simultaneously, either with a completely new value or some function of the previous value. These operations prevent race conditions in multi-threaded applications. Typically they are used to implement mutexes or semaphores. These atomic operations are also heavily used in non-blocking synchronization.

Read–modify–write instructions often produce unexpected results when used on I/O devices, as a write operation may not affect the same internal register that would be accessed in a read operation.[1] This term is also associated with RAID levels that perform actual write operations as atomic read–modify–write sequences.[2] Such RAID levels include RAID 4, RAID 5 and RAID 6.

Consensus number

Template:Excerpt

See also

References

Template:Reflist


Template:Asbox

  1. Massmind: "The read–modify–write problem"
  2. Script error: No such module "citation/CS1".