Consistency model
In computer science, consistency models are used in distributed systems like distributed shared memory systems or distributed data stores (such as a filesystems, databases, optimistic replication systems or Web caching). The system supports a given model if operations on memory follow specific rules. The data consistency model specifies a contract between programmer and system, wherein the system guarantees that if the programmer follows the rules, memory will be consistent and the results of memory operations will be predictable.
High level languages, such as C, C++, and Java, partially maintain the contract by translating memory operations into low-level operations in a way that preserves memory semantics. To hold to the contract, compilers may reorder some memory instructions, and library calls such as pthread_mutex_lock()
encapsulate required synchronization.[1]
Verifying sequential consistency is undecidable in general, even for finite-state cache-coherence protocols.[2]
Consistency models define rules for the apparent order and visibility of updates, and it is a continuum with tradeoffs.[3]
Example
Assume that the following case occurs:[3]
- The row X is replicated on nodes M and N
- The client A writes row X to node N
- After a period of time t, client B reads row X from node M
The consistency model has to determine whether client B sees the write from client A or not.
Types
A non-exhaustive list of consistency models are
- causal consistency
- delta consistency
- entry consistency
- eventual consistency
- fork consistency
- linearizability (also known as strict or atomic consistency)
- one-copy serializability
- PRAM consistency (also known as FIFO consistency)
- release consistency
- sequential consistency
- serializability
- vector-field consistency
- weak consistency
- strong consistency
See also
- Cache coherence
- Distributed shared memory
- Non-Uniform Memory Access
References
- ↑ Mark D. Hill (August 1998). "Multiprocessors Should Support Simple Memory Consistency Models". IEEE Computer 31 (8): pp.28–34. doi:10.1109/2.707614.
- ↑ Shaz Qadeer (August 2003). "Verifying Sequential Consistency on Shared-Memory Multiprocessors by Model Checking". IEEE Transactions on Parallel and Distributed Systems 14 (8): pp.730–741. doi:10.1109/TPDS.2003.1225053.
- ↑ 3.0 3.1 Todd Lipcon (2009-06-11). "Design Patterns for Distributed Non-Relational Databases". http://static.last.fm/: last.fm. Retrieved 2011-03-24. "A consistency model determines rules for visibility and apparent order of updates. Example: * Row X is replicated on nodes M and N * Client A writes row X to node N * Some period of time t elapses. * Client B reads row X from node M * Does client B see the write from client A? Consistency is a continuum with tradeoffs"
Further reading
- Ali Sezgin (2004). Formalization and verification of shared memory (PDF). (contains many valuable references)
- Kathy Yelick; Dan Bonachea, Chuck Wallace (2004). A Proposal for a UPC Memory Consistency Model (v1.0) (PDF).
- Mosberger, David (1993). "Memory Consistency Models". Operating Systems Review 27 (1): 18–26. doi:10.1145/160551.160553.
- Sarita V. Adve, Kourosh Gharachorloo (December 1996). "Shared Memory Consistency Models: A Tutorial". IEEE Computer 29 (12): 66–76. Retrieved 2008-05-28.
- Steinke, Robert C.; Gary J. Nutt (2004). "A unified theory of shared memory consistency". Journal of the ACM 51 (5): 800–849. arXiv:cs.DC/0208027. doi:10.1145/1017460.1017464.
External links
- Consistency Models
- IETF slides
- Memory Ordering in Modern Microprocessors, Part I and Part II, by Paul E. McKenney (2005). Linux Journal
|