Knowledge point 1: Under what circumstances will the cache be flushed automatically?

Thinking:
Under what circumstances do you take the initiative to flush the cache?

1. Why should we learn cache?

What does cache have to do with us software engineers? In fact, in many cases, the hardware will automatically maintain the direct consistency between cache and memory. This has nothing to do with us software engineers, so many times we do not need to understand the principle of cache. But reality is fact, whether you understand it or not, you are always using it. As a low-level software developer, sometimes you have to actively refresh the cache, that is, to maintain memory consistency in the software.
So when do you generally need to actively flush the cache (to maintain memory consistency in software)? Here are some of the most common examples.

1.1. When different Master hardware shares data

For example, a core and a crypto engine hardware share data. Software is required to proactively invalidate or flush cache operations.

1.1.1. Maintaining memory consistency in software – flush cache

Insert image description here

1.1.2. Maintaining memory consistency in software – invalid cache

Supongo que te gusta

Origin blog.csdn.net/weixin_42135087/article/details/133574898
Recomendado
Clasificación