SUMMARY OF CACHE
the idea it use
- put the currently used data int the nearest cache,
by doing this ,we can cut the time we visit the data.
-
reson
the time to visit the main memory is hundrus times of the time
to visit the cache. the more ,the time to visit the disk is 1000 thousands times of the time to visit the main memory . Meanwhile , the time of system use to calculate the data is just several cycles . So , it is very neccesery for the system to cut the time for data visiting. -
how
the second question is put which data to the cache. In the ideal case, we assume that the data system demand is always in cache.
so , there is two way to think put which to the cache- put the current data and the neighbor of the data in to the cache , which we called space correlation
- put the latest used data in the cache ,which we called temporal correlation
< then there is question that hoe to cast the physical address in to the address in cache , the numbers of data in main memory is much more than the data in cache . Obvious, we can the numbers of main memory mod the cache’s.If the result is right ,then check wether the data in cache is the data we need ,if is , we can load it from the cache , if not , we had to load it from the main memory . > then system put it into the cache .
so as the sever , which named warehouse computer
see from some aspects ,mobile devices is the same as the server devices
the main idea: how to get the data quickly. then to short the time of a procedure .
the example like this is find a book in the library
if you find the book in the libarary , the time you used is longer than the time you spend to find the book in your desktop . So you put the book you may use on the desktop early , rather than to find it just the time you need it . you can put ten or more book on your desktop , which will save you much time to find the book. but there is some difference , you just one people , the system can do the ALU and load the data in the same time ,the system can do many things in a circle.