When a program writes to memory, the processor only modifies the line in the cache, but does not update main memory.
当一个程序写入存储,处理器仅仅只会修改缓存线,而不会更新主要的存储内容。
What's more, you'll have to carefully design your program to handle memory exhaustion in arbitrary places, which is not easy.
此外,必须小心设计程序来处理任意位置的内存耗尽问题,而这不是一件容易的事情。
When the program execution leads to instructions not in the cache, then the instructions need to be fetched from the main memory and the microprocessor has to stop and wait.
当程序执行导致命令不能从快取内存中找到时,需要从主内存中找到命令,那是微处理器就停下来等待。
Why not write the program in a way where you figure out dynamically when the program is run how much memory you need rather than hard coding in two with or within that constant.
为什么不写一个可以动态的方式写那个程序,程序可以动态分配内存,而不是用常量硬编码两个值。
应用推荐