dendibakh / perf-book

The book "Performance Analysis and Tuning on Modern CPU"
https://book.easyperf.net/perf_book
Creative Commons Zero v1.0 Universal
2k stars 144 forks source link

13-2: Use coherence instance of consistenty #47

Closed pveentjer closed 3 months ago

pveentjer commented 3 months ago

Coherence and consistency have distinct meanings.

Coherence is related to the memory ordering of the same address.

Consistency is related to the memory ordering of different addresses.

Coherence is taken care of by the memory subsystem (mostly the cache).

Consistency is either the task of the programmer using fences or it is part of the CPU design to ensure a certain level of consistency (e.g. on X86 stores can't be reordered).

dendibakh commented 3 months ago

Thank you