How to change processor L1 cache, L2 cache and L3 cache?

Can the System.Runtime.Caching namespace be used to change the properties and values โ€‹โ€‹of the L1, L2, and L3 Cache CPUs?

msdn.microsoft.com told me the namespace allows you to create a new cache store in windows like virtual RAM.

But I want to program with Cache which is included in the CPU. Can you tell me how to do this?

Thanks for the solutions!

+3


source to share


1 answer


System.Runtime.Caching provides access to high-level caching facilities, typically in regular RAM with key-value pairs. (There are more use cases.) As you mentioned, MSDN says:

You can create your own caching providers. For example, instead of using the default in-memory caching mechanism, you can create your own providers that store cache data in databases, custom objects, or the file system.

But the processor cache is low-level memory that is automatically used with the processor itself to reduce the trip to RAM; So it doesn't really need to be changed by external applications.



For example, the L1 instruction cache is physically close to the processing core and stores machine code instructions, and .NET applications are not even saved as native code before they are executed by the .NET Framework (or ngen) itself, which makes for tougher operations.

CPU cache

But that doesn't mean your code can't be touched. You can write efficient code that will force the CPU to use its caches in an elegant way. For more information, see How do I write the code that makes the best use of the processor's cache for better performance?

+4


source







All Articles