Thursday, January 9, 2014

Disk Cache.

Disk Cache.

1 - When you load a program from disk cache, the memory resident program reserves a portion of memory
conventional, expanded or extended, for their exclusive use. The amount used by the cache can range from a few
kilobytes to several megabytes of RAM. Generally, the more RAM uses a cache, the more effective. Some caches earmark
certain part of memory; others require all the available memory, but parts of the release memory when other programs
need it to perform their own tasks.

2 - The CPU under the command of the application, sends a command to the hard drive, requesting data. The cache intercepts
data request.

3 - The cache reads data from the disk satisfies the request and search more data, usually in clusters of adjacent unit.
The cache passes the requested data to the CPU, but keeps a copy of them with excess data sought in RAM reserved
above.

4 - In many instances, when the CPU is not actively engaged in processing instructions, the cache takes control to
read more data on the drive, which are also stored in RAM, usually the next sectors to files already read. Each
cache has an internal logic that makes discover which blocks are more likely to be requested later
by the application. The intelligence of this logic distinguishes the efficiency of a cache for another.

5 - Later, when the program requests more data, the cache again intercepts the request and checks whether the data
requested are already in RAM. If so, the cache provides directly to the CPU without having to access the disk. Otherwise,
caching repeat the previous procedure, seeking new data, fomecendo them to the CPU and also keeping them in RAM with the
clusters extras on the disc. When the RAM used by the cache is full, it releases the data that have been there longer
no use, replacing them with data collected during the most recent procedures disk access.

6 - When a program sends a command to write data to disk, some caches intercept the data, not the recording in
disk until the CPU is idle. This makes it faster computer operations because the attention of the CPU is not
divided between the disk and record other processing.

7 - If the file to be written to disk is still in the area controlled by the RAM cache, it writes to the disk only
clusters that have changed. Some caches also remain pending writes to minimize the movements of the heads
read / write drive.

Note - The disk cache controllers work similarly to programs cache, but do not use any
system memory, or to the logic that controls the cache not to store data in the cache. The controllers
cache usually offer better performance, but are more expensive than programs cache.


Source: Evolution of Computers

No comments:

Post a Comment