memory_order::relaxed ); // atomic increment nsSum += duration_cast<nanoseconds>( high_resolution_clock::now() - start ).count(); }, ref( cacheLine.atomics[t % CL_SIZE] ) ); threads.resize( 0 ); // join all threads cout << nThreads << ": " << (int)(nsSum / (1.0e7 * nThreads) + 0.5) << endl; } } This code shows the effect of false sharing. It creates an increasing number of threads from one thread to the number of physical threads in the system. Each thread sequentially increments one byte of a cache line atomically, which as a whole is shared among all threads. The higher the level of contention between threads, the longer each increment takes. This are the results on a Zen1 system with eight cores and sixteen threads: 1: 6 2: 22 3: 33 4: 44 5: 71 6: 76 7: 102 8: 118 9: 131 10: 142 11: 159 12: 189 13: 209 14: 229 15: 248 16: 262 As you can see, on the system in question it can take up to a quarter microsecond to complete an increment operation on the shared cache line, which corresponds to approx. 1,000 clock cycles on this CPU. Mitigation There are ways of mitigating the effects of false sharing. For instance, false sharing in CPU caches can be prevented by reordering variables or adding padding (unused bytes) between variables. However, some of these program changes may increase the size of the objects, leading to higher memory use. Compile-time data transformations can also mitigate false-sharing. However, some of these transformations may not always be allowed. For instance, the C++ programming language standard draft of C++23 mandates that data members must be laid out so that later members have higher addresses. There are tools for detecting false sharing. There are also systems that both detect and repair false sharing in executing programs. However, these systems incur some execution overhead. References External links Easy Understanding on False Sharing C++ today blog, False Sharing hits again! Dr Dobbs article: Eliminate False Sharing Be careful when trying to eliminate false sharing in Java Cache coherency Computer memory