MulticoreInfo.com header image 2

Understanding and Avoiding Memory Issues with Multi-core Processors

December 11th, 2008 · No Comments




by Shameem Akhter and Jason Roberts for Dr. Dobb’s Journal
For multi-core programs, working within the cache becomes trickier, because data is not only transferred between a core and memory, but also between cores. As with transfers to and from memory, mainstream programming languages do not make these transfers explicit. The transfers arise implicitly from patterns of reads and writes by different cores. The patterns correspond to two types of data dependencies:

* Read-write dependency. A core writes a cache line, and then a different core reads it.
* Write-write dependency. A core writes a cache line, and then a different core writes it.

An interaction that does not cause data movement is two cores repeatedly reading a cache line that is not being written. Thus if multiple cores only read a cache line and do not write it, then no memory bandwidth is consumed. Each core simply keeps its own copy of the cache line.

To minimize memory bus traffic, minimize core interactions by minimizing shared locations. Hence, the same patterns that tend to reduce lock contention also tend to reduce memory traffic, because it is the shared state that requires locks and generates contention. Letting each thread work on its own local copy of the data and merging the data after all threads are done can be a very effective strategy.

Full Story

Related Posts
The “Nulticore” effect
Is Multicore Bad News For Supercomputers?
Is more than 16 cores pointless?
Is Multicore The Way To Go?
Multi-Core a Drag on Some HPCs
The many-core performance wall

  • Share/Save/Bookmark

Tags: Memory · MulticoreInfo · Performance · Programming

Like what you're reading? Come back every day for multicore news, or subscribe to RSS updates.



Stumble It!