> For the complete documentation index, see [llms.txt](https://amartyushov.gitbook.io/tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://amartyushov.gitbook.io/tech/programming-languages/java/multithreading/false-sharing.md).

# False sharing

Notes:

* most modern processors not only cache the requested value but also cache a few more nearby values.&#x20;
  * processor caches are working in terms of cache lines, instead of single cacheable values.
* When multiple processors are operating on the same or nearby memory locations, they may end up sharing the same cache line.
*

![](https://415484505-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LxtoAXZwwOc4XGto8vb%2Fuploads%2FQQ7Q3hRaAo1PhUW0XLPd%2FScreenshot%202022-03-11%20at%2009.15.01.png?alt=media\&token=1dc54ec0-55b5-40f8-9a8a-f8329f607a57)

{% hint style="info" %}
False sharing happens in invisible way

Hard to predict, hits the performance
{% endhint %}
