Jump to content

Memory coherence: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Addbot (talk | contribs)
m Bot: Migrating 3 interwiki links, now provided by Wikidata on d:q4226071
Lightbloom (talk | contribs)
(17 intermediate revisions by 11 users not shown)
Line 1: Line 1:
'''Memory coherence''' is an issue that affects the design of [[computer system]]s in which two or more [[Central processing unit|processor]]s or [[Multi core|cores]] share a common area of [[memory (computers)|memory]].<ref name="censier98">{{Cite journal
'''Memory coherence''' is an issue that affects the design of [[computer system]]s in which two or more [[Central processing unit|processor]]s or [[Multi core|cores]] share a common area of [[memory (computers)|memory]].<ref name="censier98">{{Cite journal |first1=L.M. |last1=Censier |first2=P. |last2=Feautrier |title=A New Solution to Coherence Problems in Multicache Systems |journal=IEEE Transactions on Computers |volume=C-27 |issue=12 |pages=1112–18 |date=December 1978 |doi=10.1109/TC.1978.1675013|s2cid=5898229 }}</ref><ref name="smith82">{{Cite journal
|first1=Alan Jay |last1=Smith |title=Cache Memories |journal=ACM Computing Surveys |volume=14 |issue=3 |pages=473–530 |date=September 1982 |doi=10.1145/356887.356892 |s2cid=6023466 }}</ref><ref name="li89">{{Cite journal |first1=Kai |last1=Li |first2=Paul |last2=Hudak |title=Memory coherence in shared virtual memory systems |journal=Transactions on Computer Systems |volume=7 |issue=4 |pages=321–59 |date=November 1989 |doi=10.1145/75104.75105 |s2cid=1678750 |doi-access=free }}</ref><ref name="stenstrom90">{{Cite journal |first1=Per |last1=Stenstrom |title=A survey of cache coherence schemes for multiprocessors |journal=IEEE Computer |volume=23 |issue=6 |pages=12–24 |date=June 1990 |doi=10.1109/2.55497}}</ref>
| first1 = L.M.
| last1 = Censier
| first2 = P.
| last2 = Feautrier
| title = A New Solution to Coherence Problems in Multicache Systems
| journal = IEEE Transactions on Computers
| volume = C-27
| issue = 12
| pages = 1112–1118
| publisher = IEEE
| date = December 1978
| doi = 10.1109/TC.1978.1675013
}}
</ref><ref name="smith82">{{Cite journal
| first1 = Alan Jay
| last1 = Smith
| title = Cache Memories
| journal = ACM Computing Surveys
| volume = 14
| issue = 3
| pages = 473–530
| publisher = ACM
| url = http://doi.acm.org/10.1145/356887.356892
| format = pdf
| date = September 1982
| doi = 10.1145/356887.356892
| accessdate = 2011-02-25}}
</ref><ref name="li89">{{Cite journal
| first1 = Kai
| last1 = Li
| first2 = Paul
| last2 = Hudak
| title = Memory coherence in shared virtual memory systems
| journal = Transactions on Computer Systems
| volume = 7
| issue = 4
| pages = 321–359
| publisher = ACM
| url = http://doi.acm.org/10.1145/75104.75105
| format = pdf
| date = November 1989
| doi = 10.1145/75104.75105
| accessdate = 2011-02-25}}
</ref><ref name="stenstrom90">{{Cite journal
| first1 = Per
| last1 = Stenstrom
| title = A survey of cache coherence schemes for multiprocessors
| journal = IEEE Computer
| volume = 23
| issue = 6
| pages = 12–24
| publisher = IEEE
| date = June 1990
| doi = 10.1109/2.55497
}}
</ref>


In a [[uniprocessor]] system (whereby, in today's terms, there exists only one core), there is only one processing element doing all the work and therefore only one processing element that can read or write from/to a given memory location. As a result, when a value is changed, all subsequent read operations of the corresponding memory location will see the updated value, even if it is [[cache (computing)|cache]]d.
In a [[uniprocessor]] system (where there exists only one core), there is only one [[processing element]] doing all the work and therefore only one processing element that can read or write from/to a given memory location. As a result, when a value is changed, all subsequent read operations of the corresponding memory location will see the updated value, even if it is [[cache (computing)|cache]]d.


Conversely, in [[multiprocessor]] (or [[Multi core|multicore]]) systems, there are two or more processing elements working at the same time, and so it is possible that they simultaneously access the same memory location. Provided none of them changes the data in this location, they can share it indefinitely and cache it as they please. But as soon as one updates the location, the others might work on an out-of-date copy that, e.g., resides in their local cache. Consequently, some scheme is required to notify all the processing elements of changes to shared values; such a scheme is known as a "memory coherence protocol", and if such a protocol is employed the system is said to have a "coherent memory".
Conversely, in [[multiprocessor]] (or [[Multi core|multicore]]) systems, there are two or more processing elements working at the same time, and so it is possible that they simultaneously access the same memory location. Provided none of them changes the data in this location, they can share it indefinitely and cache it as they please. But as soon as one updates the location, the others might work on an out-of-date copy that, e.g., resides in their local cache. Consequently, some scheme is required to notify all the processing elements of changes to shared values; such a scheme is known as a '''memory coherence protocol''', and if such a protocol is employed the system is said to have a '''coherent memory'''.


The exact nature and meaning of the memory coherency is determined by the [[consistency model]] that the coherence protocol implements. In order to write correct concurrent programs, programmers must be aware of the exact consistency model that is employed by their systems.
The exact nature and meaning of the memory coherency is determined by the [[consistency model]] that the coherence protocol implements. In order to write correct concurrent programs, programmers must be aware of the exact consistency model that is employed by their systems.


When implemented in hardware, the coherency protocol can, e.g., be [[Directory-based coherence protocols|directory based]] or employ [[Bus sniffing|snooping]] (a.k.a. "sniffing"). Examples of specific protocols are the [[MSI protocol]] and its derivatives [[MESI protocol|MESI]], [[MOSI protocol|MOSI]] and [[MOESI protocol|MOESI]].
When implemented in hardware, the coherency protocol can, for example, be [[Directory-based coherence protocols|directory-based]] or [[Bus sniffing|snooping]]-based (also called ''sniffing''). Specific protocols include the [[MSI protocol]] and its derivatives [[MESI protocol|MESI]], [[MOSI protocol|MOSI]] and [[MOESI protocol|MOESI]].


==References==
== See also ==
{{Reflist}}

==See also==
*[[Bus sniffing]]
*[[Cache coherence]]
*[[Cache coherence]]
*[[Consistency model]]
*[[Directory-based coherence protocols]]
*[[Distributed shared memory]]
*[[Distributed shared memory]]
*[[Race condition]]
*[[Race condition]]

== References ==
{{Reflist|35em}}


{{Parallel Computing}}
{{Parallel Computing}}

Revision as of 18:09, 6 September 2023

Memory coherence is an issue that affects the design of computer systems in which two or more processors or cores share a common area of memory.[1][2][3][4]

In a uniprocessor system (where there exists only one core), there is only one processing element doing all the work and therefore only one processing element that can read or write from/to a given memory location. As a result, when a value is changed, all subsequent read operations of the corresponding memory location will see the updated value, even if it is cached.

Conversely, in multiprocessor (or multicore) systems, there are two or more processing elements working at the same time, and so it is possible that they simultaneously access the same memory location. Provided none of them changes the data in this location, they can share it indefinitely and cache it as they please. But as soon as one updates the location, the others might work on an out-of-date copy that, e.g., resides in their local cache. Consequently, some scheme is required to notify all the processing elements of changes to shared values; such a scheme is known as a memory coherence protocol, and if such a protocol is employed the system is said to have a coherent memory.

The exact nature and meaning of the memory coherency is determined by the consistency model that the coherence protocol implements. In order to write correct concurrent programs, programmers must be aware of the exact consistency model that is employed by their systems.

When implemented in hardware, the coherency protocol can, for example, be directory-based or snooping-based (also called sniffing). Specific protocols include the MSI protocol and its derivatives MESI, MOSI and MOESI.

See also

References

  1. ^ Censier, L.M.; Feautrier, P. (December 1978). "A New Solution to Coherence Problems in Multicache Systems". IEEE Transactions on Computers. C-27 (12): 1112–18. doi:10.1109/TC.1978.1675013. S2CID 5898229.
  2. ^ Smith, Alan Jay (September 1982). "Cache Memories". ACM Computing Surveys. 14 (3): 473–530. doi:10.1145/356887.356892. S2CID 6023466.
  3. ^ Li, Kai; Hudak, Paul (November 1989). "Memory coherence in shared virtual memory systems". Transactions on Computer Systems. 7 (4): 321–59. doi:10.1145/75104.75105. S2CID 1678750.
  4. ^ Stenstrom, Per (June 1990). "A survey of cache coherence schemes for multiprocessors". IEEE Computer. 23 (6): 12–24. doi:10.1109/2.55497.