Computers, Information Technology
What is cached data and caching?
The computer, alas, does not immediately execute the commands that it receives from people. To speed up this process a number of tricks are applied, and an honorable place among them belongs to caching. What it is? What are the cached data? How does this process actually happen? What is the cached data in the smartphone "Samsung", for example, and they differ from something that is in the computer? Let's get to the answers to these questions.
What is a cache?
Process of use
Updating data
When using, say, a web browser, the local cache is scanned to find a copy of the page. Given the limitations of this type of memory, with a miss, it is decided to discard some information to free space. To solve what exactly will be replaced, various wipe algorithms are used. By the way, if we talk about what cached data is on Android, then in mass they are used to work with pictures and application data.
Write policy
- Immediate recording. Each change is synchronously entered in the main memory.
- Delayed or reverse recording. Data is updated periodically or upon request from the client. To track whether a change was made, use a symptom with two states: "dirty" or changed. In case of a miss, two calls directed to the main memory can be made: the first is used to write down data that has been changed from the cache, and the second is to read the required item.
It can also be that the information in the intermediate buffer becomes irrelevant. This happens when you change the data in the main memory without making any adjustments to the cache. For the consistency of all editing processes, coherence protocols are used.
Modern Challenges
Synchronizing data between different buffers
The cache is useful when there is one, but how to keep the effectiveness of this technology, if there are a lot of them? This problem is solved by the coherence of the buffer. There are three options for data exchange:
- Inclusive. The cache can behave as you like.
- Exclusive. Developed for each specific case.
- Non-Exclusive. The standard of wide distribution.
Levels of caching
- L1 cache. The fastest level of the cache is the first. In fact, it is part of the processor, because it is located on the same chip and belongs to the functional blocks. It is usually divided into two types: a cache of instructions and data. Most modern processors without this level do not work. This cache functions at the processor frequency, so every cycle can access it.
- L2 cache. Usually it is located together with the previous one. It is a memory of separate use. To find out its value, you need to divide the whole volume given for data caching into the number of cores that is in the processor.
- L3 cache. Slow, but the biggest dependent cache. Usually more than 24 MB. Used to synchronize data that comes from different L2 caches.
- L4 cache. The use is justified only for high-performance multiprocessor mainframes and servers. It is implemented as a separate chip. If you ask a question about what data caching is in the Samsung smartphone and look for it in this level - I can say that the years at 5 precisely went ahead.
Cache associativity
This is a fundamental characteristic. The associativity of cached data is necessary for mapping logical segmentation. It, in turn, is necessary because the sequential search of all available lines takes dozens of cycles and reduces all advantages to it. Therefore, a rigid binding of RAM cells to the cache data is used, to shorten the search time. If we compare the intermediate buffers, which have the same volume, but different associativity, then the one with the larger one will work less quickly, but with significant specific efficiency.
Conclusion
Similar articles
Trending Now