EngWiPy
- 1,361
- 61
I don't remember studying anything about cache in the OS course. It was taught in the computer architecture course.
I agree. But that being said, I think that it is a subject for an advanced, specialized programmer. A typical programmer would have a long time to learn about cache before anyone expects him to deal with these issues. And they would probably do it with frequent consultation with the manufacturer.nsaspook said:It depends on what type of programmer you are.Embedded/systems programming in C at the kernel/driver level even on devices like the 4 core RPi3 ARM8 with cache requires very close attention to cache issues that affect processor pipeline, branch execution times, memory barriers for cache coherency and such.
Here we go again...FactChecker said:A typical programmer would have a long time to learn about cash before anyone expects him to deal with these issues.
Mark44 said:Here we go again...

Common folk has to rely on the various 'performance optimization guide' documents, like this. Almost all CPU (and: GPU) manufactuer provides similar documents.FactChecker said:And they would probably do it with frequent consultation with the manufacturer.
Ok. I'll buy that. My experience was in an unusual environment.Rive said:Apart from professionals there are many amateurs who tries to give it a try on this field. It's just the matter of performance bottlenecks, and without access to professional programming materials it's surprisingly frequent.
phinds said:But it is NOT just data. Not just things like loop counters, it is the program code as well as data.
newjerseyrunner said:You can not access the cache in any language other than assembly
But there are important clever exceptions. For instance, they usually assume that the last instruction of a loop is followed by the first instruction of the loop, because there are usually several loops before the loop is done. It is very hard to do better than the automatic optimization. It's usually best to respect it and work with it. Unfortunately, in a lot of safety critical work, the optimization must be kept at very low levels or turned off completely.Vanadium 50 said:True, but this takes care of itself. When an instruction is executed, the odds are very high that the next instruction executed is the next instruction in memory, and that was read into the cache at the same time the instruction in question was loaded.
Yes, for most processors, cache is primarily a processor feature that operates with little or no direct encouragement from the software.phinds said:I don't think cache management is part of the O.S. it is part of the on-board processing, the "computer within the computer" as it were. I'm not 100% sure that that's always the case.
Kind of, but not really.fluidistic said:Is it possible to store a small .txt file into the cache?"
Intel said:MCDRAM is a ... low capacity (up to 16GB) memory
rootone said:The primitive video game 'space invaders' could be done in one kilobyte.
Interesting. It looks like the MCDRAM is Level-3 memory that can be used entirely as cache, entirely as addressable memory, or split between the two, depending on the BIOS settings. https://colfaxresearch.com/knl-mcdram/ has examples of how to use it in each case. So it can be directly controlled by the programmer as addressable memory and be faster than Level-3 cache.rbelli1 said:https://software.intel.com/en-us/bl...dram-high-bandwidth-memory-on-knights-landing
In what world is 16GB a small amount of RAM? It's not an impressively large amount but still quite a lot.
Swing that at me in a few years and it will probably be a whole different story.
BoB
Atari yeah, things like CPU directly addressing video RAM.rbelli1 said:1/8 kilobyte on the Atari 2600. Not as nice as the arcade version but still impressive what you can do with 128 bytes.
BoB
rootone said:CPU directly addressing video RAM
16GB of close DRAM is certainly a performance opportunity. Bump that to SRAM and you can fly.FactChecker said:programmer as addressable memory and be faster than Level-3 cache
rbelli1 said:In what world is 16GB a small amount of RAM?
Vanadium 50 said:In a world where it is shared by 256 processes.