天天看點

cache VS buffer

Cache vs Buffer

Both cache and buffer are temporary storage areas but they differ in many ways. The buffer is mainly found in ram and acts as an area where the CPU can store data temporarily, for example, data meant for other output devices mainly when the computer and the other devices have different speeds. This way the computer can perform other tasks. Cache, on the other hand, is a high-speed storage area that can be part of the main memory or some other separate storage area like a hard disk. These two methods of caching are referred to as memory caching and disk caching respectively.

To ensure the high speed, cache is made of static ram rather than dynamic ram used for the other part of the memory since this is slower. This area is used to store information that is accessed by almost all the programs when they are running, and this makes it faster rather than searching for this information from the disk each time a program is running as this would be much slower. The buffer is made up of ordinary ram running in the computer, and it keeps track of changes happening in a running program by temporarily storing them before the changes are finally saved in the disk, for example, with word processors where the task being written is first stored in the buffer, and the word processor later updates the file in the disk with the contents of the buffer.

The buffer is mostly used for input/output processes, for example, in printing. When one sends the documents to be printed to the printer, the information is stored in a buffer, and the printer can then access this information at its own pace, and this frees the CPU to perform other tasks. A buffer is also used when burning information to compact disks where the data to be burned is first stored in the buffer from where it is then transferred to the disk during the burning process. Cache is mostly used during reading and writing processes to the main disk to make the process faster by making similar data used by different programs easily accessible.

Cache can either be part of ram or the disk. When the main disk is used as a cache, the process is referred to as disk caching, and this also works as memory caching where the recently used data is stored in the disk cache. If a running program wants to access data from the disk, it first checks the disk cache and will only check the disk if the required data is not available in the disk cache. This makes the data access process much faster since accessing it from the disk is much slower. A buffer can only be part of ram.

Summary:

1.Cache is a high-speed storage area while a buffer is a normal storage area on ram for temporary storage.

2.Cache is made from static ram which is faster than the slower dynamic ram used for a buffer.

3.The buffer is mostly used for input/output processes while the cache is used during reading and writing processes from the disk.

4.Cache can also be a section of the disk while a buffer is only a section of the ram.

5.A buffer can be used in keyboards to edit typing mistakes while the cache cannot.

Read more: Difference Between Cache and Buffer | Difference Between http://www.differencebetween.net/technology/hardware-technology/difference-between-cache-and-buffer/#ixzz5HoA7OHJB

繼續閱讀