Friday 8 March 2019

multithreading - Code/Program memory and caching



I know that any data could be cached from main memory to cache memory that provides faster access from the CPU than does main memory.




I know as well that each thread has it's own stack memory.



So the question is, could the program/code memory be cached as well? or is the caching exclusive to data blocks, not instructions block?


Answer



Yes, the machine instructions of the program can be cached as well. In fact, some processors have separate caches for instructions and data, while in other processors they share a single cache.


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...