Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

Learning How to use the Cache Effectively

New Contributor I
Hi everyone,

I posted a separate thread that discussed using the cache effectively with respect to data structures. This raises a separate question. I've read a lot about the importance of using the cache effectively in software, and the performance hits of a "cold" cache.

I am not an engineer, rather I'm a computer scientist that usually concentrates on algorithmic complexity in implementations. I would like to learn more about using the cache effectively in my software programs. At this point I really know nothing about what cache-friendly software would even look like... I know what the cache is for from a high level architectural view, but really know nothing about the details.

Are there specific books or resources that I could learn from? I'm under the impression that different processors (i.e. AMD vs. Intel) have different cache designs. Would the resultant source code I generate normally be tuned for each cache design, or is there a general approach?

Perhaps more importantly, why should I care about the cache? Is it not the role of libraries like TBB and the compiler to care about this for me?

One resource I found, that I will be reading today, is here:

Thanks a lot,

0 Kudos
1 Reply
Honored Contributor III
Drepper's articles appear to be an excellent reference. He touches on the differences in cache architecture which may be relevant. Of course, you are correct, one of the selling points of TBB is provision of worked examples demonstrating how to deal with cache architecture. As a computer scientist, if you have any interest in performance, you must observe these issues, particularly where they involve data structure.
0 Kudos