-
Book Overview & Buying
-
Table Of Contents
The C++ Programmer's Mindset
By :
Computers store data and instructions in various media, depending on the amount of time it will be stored and how quickly it needs to be accessed. You’re probably familiar with disk storage, where your documents and programs are stored long-term, and random access memory (RAM, or simply memory). The processor itself contains registers and the cache, which are very fast but small in size. In this section, we look at the various layers of storage for active programs (not long-term disk storage in general). We start with registers and work our way up through the layers from fastest to slowest, and conclude the section with an example of cache-friendly matrix multiplication.
We can see (most of) the various layers of the storage spectrum in Figure 4.1. Here, we see the register page that is part of each CPU core, the L1–L3 caches, and the system RAM (connected via the MMU). What isn’t shown in the figure explicitly are the long-term storage...