35
edits
Changes
→Location of the problem - Local cache
= Location of the problem - Local cache =
False sharing occurs when two threads simultaneously access logically independent data in the same cache line, and where have at least one thread is writing. It is comment issue in symmetric multiprocessor (SMP) system. In SMP, each multi-processor has their own shared-memory architectures. There is a potential for those architectures being in a same cache line managed by the caching mechanism, as they are small enough. [[File:Smp.PNG]]The caching coherency protocol would not allow other party to access the data. Except those data shares a cache block with data. Those data are protected by a hardware write lock that only one core can hold at a time. When two processors are both altered data, the protocol would force the first participant to update the whole unit despite a lack of logical necessity. Each update of an individual element of a cache line marks the line as invalid. Other processors accessing a different element in the same line see the line marked as invalid. They are forced to fetch a more recent copy of the line from memory or elsewhere, even though the element accessed has not been modified. This is because cache coherency is maintained on a cache-line basis, and not for individual elements. As a result, there will be an increase in interconnect traffic and overhead.
[[File:SmpPainter_1.PNG]][[File:Painter_2.PNG]][[File:Painter_3.PNG]]
===How MESI protocol works:===