
Avoiding and identifying false sharing among threads (2011) - kahlonel
https://software.intel.com/en-us/articles/avoiding-and-identifying-false-sharing-among-threads
======
manicdee
From the abstract:

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)

------
drmeister
Dang - that's helpful. Earlier today I posted here
([https://news.ycombinator.com/item?id=22456642](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!

~~~
kahlonel
I saw your top comment on this thread. I didn't read the article, but I wonder
why MacOS doesn't have the invalidation problem?

------
asdff
From the headline I thought this could have been about spotting misinformation
on forums and social media. Far more tame.

------
JoshTriplett
(2011), though it's still relevant today.

