文档介绍:How Caching Works
by Guy Provost
If you have been shopping for puter, then you have heard the word "cache." Modern
computers have both L1 and L2 caches. You may also have gotten advice on the topic from well-
meaning friends, perhaps something like "Don't buy that Celeron chip, it doesn't have any cache
in it!"
It turns out that caching is an puter-science process that appears on every
computer in a variety of forms. There are memory caches, hardware and software disk caches,
page caches and more. Virtual memory is even a form of caching. In this article, we will explore
caching so you can understand why it is so important.
A Simple Example
Caching is a technology based on the memory subsystem of puter. The main purpose
of a cache is to accelerate puter while keeping the price of puter low. Caching
allows you to do puter tasks more rapidly.
To understand the basic idea behind a cache system, let's start with a super-simple example that
uses a librarian to demonstrate caching concepts. Let's imagine a librarian behind his desk. He is
there to give you the books you ask for. For the sake of simplicity, let's say you can't get the
books yourself -- you have to ask the librarian for any book you want to read, and he fetches it for
you from a set of stacks in a storeroom (the library of congress in Washington, ., is set up this
way). First, let'