Wednesday, January 23, 2013

CPU Cache and its effects on concurrent algorithms

Understanding CPU caches is important to optimize code and algorithms, and some details are vital to concurrent algorithms. For an overall explanation of caches here is a good post:

In the link above, Example 6 "False cache line sharing" exemplifies what happens when multiple threads try to access the same cache line in a multi-core system. This is exactly why the ScalableRWLock shown in the previous post, is scalable.

No comments:

Post a Comment