96
edits
Changes
→What is False Sharing?
=What is False Sharing?=
In symmetric multiprocessor systems Symmetric Multiprocessor (SMP)systems , each processor has a local cahcecache. The local cache is a smaller, faster memory which stores copies of data from frequently used main memory locations It is closer to the CPU than the main memory and intended to make memory access more efficient. In a shared memory multiprocessor system with a separate cache memory for each processor, it is possible to have many copies of shared data: one copy in the main memory and one in the local cache of each processor that requested it. When one of the copies of data is changed, the other copies must guarantee cache reflect that change. Cache coherenceis the discipline which ensures that the changes in the values of shared operands(data) are propagated throughout the system in a timely fashion. False sharing occurs when threads on different processors modify variables that reside on the same cache line. This invalidates the cache line and forces an update, which hurts performance.
False sharing is a well-know performance issue on SMP systems, where each processor has a local cache. it occurs when treads on different processors modify varibles that reside on th the same cache line like so.