4 ms·
Avoiding and identifying false sharing among threads (2011)
- JoshTriplett 7y ago(2011), though it's still relevant today.
- deleted 7y ago[deleted]
- asdff 7y agoFrom the headline I thought this could have been about spotting misinformation on forums and social media. Far more tame.
- manicdee 7y agoFrom 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 7y agoDang - 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 7y agoI saw your top comment on this thread. I didn't read the article, but I wonder why MacOS doesn't have the invalidation problem?