I came across a suggestion for threads not to access same cache lines and I really cant understand why, also while doing a search on that topic I came around with this questions: Multiple threads and CPU cache where one of the answers suggested:
you just want to avoid two threads from simultaneously trying to access data that is located on the same cache line
The way I see it, the cache stores pages of memory for quick access from the process, And as it says here:http://en.wikipedia.org/wiki/Thread_%28computing%29#How_threads_differ_from_processes
threads share their address space
It shouldn't be a problem for two threads to access same cache line since if a page is in the cache and a thread trying to access the memory will get a cache hit regardless of the other thread.
I heard the argument about avoiding threads from accessing same cache line on several different occasions so it cant be a myth. What am I missing here?