cache和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/#ixzz5JQ1X8VvP

 

来自 <http://www.differencebetween.net/technology/hardware-technology/difference-between-cache-and-buffer/>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值