In symmetric multiprocessor (SMP) systems, each processor has a local cache. The memory system must guarantee cache coherence. 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. This article covers methods to detect and correct false sharing.
(in case you were like me and wondered what “false sharing” means)
Dang - that's helpful.
Earlier today I posted here (https://news.ycombinator.com/item?id=22456642) about how throwing exceptions in C++ threads was very expensive because there is appears to be a mutex in the exception handling code. Now I can put a name to it "false sharing" - thanks!
In symmetric multiprocessor (SMP) systems, each processor has a local cache. The memory system must guarantee cache coherence. 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. This article covers methods to detect and correct false sharing.
(in case you were like me and wondered what “false sharing” means)