Memory coherence
From Wikipedia, the free encyclopedia
Memory coherence is an issue that affects the design of computer systems in which two or more processors share a common area of memory.
A computer system does useful work by reading data from permanent storage into memory, performing some operation on that data (such as adding up two numbers) and then storing the result back to permanent storage. In a uniprocessor system (such as a simple personal computer) there is only one processor doing all the work, and therefore only one processor that can read or write the data values. Moreover a simple uniprocessor can only do one thing at a time, so when a value in storage is changed, all subsequent read operations will see the updated value.
In multiprocessor systems however there are two or more processors working at the same time, so there is the possibility that the processors will all want to process the same value at the same time. Provided none of the processors updates the value then they can share it indefinitely, but as soon as one updates the value, the others will be working on an out-of-date copy. Some scheme is required to notify all processors of changes to shared values; such a scheme is known as a "memory coherence protocol". The coherency is not enough to be able to write concurrent programs and thus comes along a cache consistency model.
Various protocols have been devised for maintaining memory coherency, such as the MESI protocol, MSI protocol, MOSI protocol and the MOESI protocol. Most of the cache protocols in multiprocessors support a sequential consistency model.