Lets take a library as an example to understand how caching works. Imagine a large library but with only one librarian (the standard one CPU setup). The first person comes into the library and asks for a book titled "Lord of the Rings". The librarian goes off follows the path to the bookshelves (Memory Bus) retrieves the book and gives it to the person. The book is returned to the library once its finished with. Now without cache the book would be returned to the shelf. When the next person arrives and asks for "Lord of the Rings", the same process happens and takes the same amount of time.
But, if this library had a cache system then once the book was returned it would have been put on a shelf at the librarians desk. This way once the second person comes in and asks for "Lord of the Rings", the librarian only has to reach down to the shelf and retrieve the book. This significantly reduces the time it takes to retrieve the book. Back to computing this is the same idea, the data in the cache is retrieved much quicker. The computer uses its logic to determine which data is the most frequently accessed and keeps them books on the shelf so to speak.
Similarly, more level of caching desk (computer cache) can be possible which indeed the case for the modern computer systems architecturs.
No comments:
Post a Comment