The description of cache
in the book is always very general. I am a student in the field of architecture. I want to understand the behavior of the cache
in more detail.
In the c/c++ language code, what data will be loaded from the memory to the cache? Will it be loaded into the cache when it is frequently used? For example, when I write a for loop in C language, I often use variables i, j, and k
. Will these also be loaded into the cache? C language local variables are generally placed in the stack area, global variables will be placed in the data area? Will these be loaded into the cache first when they are used?
The pointer variable p
stores the address of the data. If I use the pointer *p
to access a variable. Will p
be loaded into the cache first, and then *p
will be loaded into the cache?
没有评论:
发表评论