r/shittyprogramming • • Feb 03 '18

okay, think i understand cache memory now.

Post image
221 Upvotes

17 comments sorted by

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)".

16

u/Phillipwnd Feb 03 '18

(RAV)*

8

u/PaezRice Feb 03 '18

oh, you're right. i alrdy wondered what the hell RAM is meant to be

2

u/tylerfb11 Feb 17 '18

Decoy snail? Or the real thing?

5

u/loics2 Feb 03 '18

Is it to illustrate Spectre and meltdown?

4

u/[deleted] 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

u/ILikeLenexa Feb 03 '18

What are registers if not a cache.

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

2

u/jarfil Feb 04 '18 edited Dec 02 '23

CENSORED

2

u/rawrspace Feb 04 '18

I'm dissapointed that /r/shittypowerpoint is not a thing

3

u/[deleted] Feb 03 '18

This isn't programming

2

u/RenaKunisaki Feb 03 '18

Must be a concurrency issue.

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

u/Who_GNU Feb 03 '18

It's like that, because it's small and very fast.