I
I
Ilya bow2017-04-04 16:05:52
Programming
Ilya bow, 2017-04-04 16:05:52

Who is in charge of allocating memory between RAM and 3 levels of processor cache? Software (programmer) or hardware (hardware)?

Here, let's say, can a program be written (or optimized xs as it should be) to work with cache 1 and 2 levels and not use 3 at all?
Or how does it happen?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sly_tom_cat ., 2017-04-04
@8889996

The microcode of the processor controls this.
If you understand how these caches work, then yes, you can try to write a program that will be effectively cached during execution, but it’s not a fact that some data will be guaranteed to be taken from the cache. After all, the task is not one executed on the processor (as a rule).

D
Dmitry, 2017-04-04
@TrueBers

What every programmer should know about memory

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question