title: False Sharing and Atomic Variables
body: <p>When different variables are inside the same cache line, you can experience <a href="http://en.wikipedia.org/wiki/False_sharing" rel="noreferrer">False Sharing</a>, which means that even if two different threads (running on different cores) are accessing two different variables, if those two variables reside in the same cache line, you will have performance hit, as each time cache coherence will be triggered. </p>
  
  <p>Now say those variables are atomic variables (By atomic I mean variables which introduce a memory fence, such as the <code>atomic&lt;t&gt;</code> of C++), will false sharing matter there, or it does not matter if atomic variables are in the same cache line or not, as supposedly they will introduce cache coherence anyway. In other words, will putting atomic variables in the same cache line make application slower than not putting them in the same cache line?</p>