- 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]
Contents
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 does see 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
See also
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.
- ^ a b Todd Lipcon (2009-06-11). "Design Patterns for Distributed Non-Relational Databases". http://static.last.fm/: last.fm. http://static.last.fm/johan/nosql-20090611/intro_nosql.pdf. 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) (PDF). Formalization and verification of shared memory. http://www.atilim.edu.tr/~asezgin/diss_finalcopy.pdf. (contains many valuable references)
- Kathy Yelick; Dan Bonachea, Chuck Wallace (2004) (PDF). A Proposal for a UPC Memory Consistency Model (v1.0). http://www.gwu.edu/~upc/downloads/upcmem.pdf.
- Mosberger, David (1993). "Memory Consistency Models". Operating Systems Review 27 (1): 18–26. doi:10.1145/160551.160553. http://citeseer.ist.psu.edu/mosberger93memory.html.
- Sarita V. Adve, Kourosh Gharachorloo (December 1996). "Shared Memory Consistency Models: A Tutorial". IEEE Computer 29 (12): 66–76. http://www.hpl.hp.com/techreports/Compaq-DEC/WRL-95-7.pdf. 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
Parallel computing General Levels Threads Theory Elements Coordination Multiprocessing · Multithreading (computer architecture) · Memory coherency · Cache coherency · Cache invalidation · Barrier · Synchronization · Application checkpointingProgramming Hardware Multiprocessor (Symmetric · Asymmetric) · Memory (NUMA · COMA · distributed · shared · distributed shared) · SMT
MPP · Superscalar · Vector processor · Supercomputer · BeowulfAPIs Ateji PX · POSIX Threads · OpenMP · OpenHMPP · PVM · MPI · UPC · Intel Threading Building Blocks · Boost.Thread · Global Arrays · Charm++ · Cilk · Co-array Fortran · OpenCL · CUDA · Dryad · DryadLINQProblems Embarrassingly parallel · Grand Challenge · Software lockout · Scalability · Race conditions · Deadlock · Livelock · Deterministic algorithm · Parallel slowdown
Categories:- Consistency models
- Transaction processing
Wikimedia Foundation. 2010.