r/shittyprogramming • u/[deleted] • Feb 03 '18
okay, think i understand cache memory now.
5
4
Feb 03 '18
I don't much like the diagram on the right, kind of suggests you have to go through cache to get to main memory
2
1
u/Vectrexian Feb 12 '18
Except you frequently do have to do that. On many out-of-order microarchitectures, the CPU assumes cache hit for ALL operations. A miss results in the processor cancelling any in-flight instructions which assumed the data read back from the cache was valid, and instead reloads the data from the cache (which is now valid) and starts again. The Pentium 4 has a particularly strange (and nasty) variant of this strategy: https://en.wikipedia.org/wiki/Replay_system
1
u/WikiTextBot Feb 12 '18
Replay system
The replay system is a little-known subsystem within the Intel Pentium 4 processor. Its primary function is to catch operations that have been mistakenly sent for execution by the processor's scheduler. Operations caught by the replay system are then re-executed in a loop until the conditions necessary for their proper execution have been fulfilled.
[ ^PM | Exclude ^me | Exclude from ^subreddit | FAQ / ^Information | ^Source | ^Donate ] Downvote to remove | v0.28
3
u/ChezMere Feb 03 '18
You're looking for /r/PowerpointsOpenedOnComputersWithDifferentFonts, I think.
2
3
2
2
u/shouya Feb 04 '18
This is a good illustration on how CPU enters out-of-order execution to achieves micro-instruction level concurrency.
1
29
u/PaezRice Feb 03 '18
Isn't it obvious? "Cache is a snail an cut of very fast, expensive nenay in the CPU" and "It can be accessed faster than regular nainnenery (RAM)".