buffer 是 "儲放 預先讀取及稍後寫入的資料".
因為機械裝置移動比較慢的緣故,
所以在讀取某一區域時,預先把鄰近區域的資料先讀取進來,
同理,寫入時先儲放在BUFFER,待較空閒時再寫回磁盤.
( http://en.wikipedia.org/wiki/Buffer_%28computer_science%29 英文內容和我的理解不一定一樣)
CPU cache或 OS 的disk cache,
則是 "最近處理過的資料或指令,因為相依性的關係,最近被處理過的資料或指令,通常會有很高的機會再被使用,所以找一個地方還放這些資料或指令"
(http://en.wikipedia.org/wiki/Cache 英文內容和我的理解不一定一樣)
好像是這樣分.
找kiwi 也說是很多人會誤解.
kiwi 中對兩者的比較:
(http://en.wikipedia.org/wiki/Cache#The_difference_between_buffer_and_cache)
======================
The difference between buffer and cache
The terms are not mutually exclusive and the functions are frequently combined; however, there is a difference in intent. A buffer is a temporary memory location, that is traditionally used because CPU instructions cannot directly address data stored in peripheral devices. Thus, addressable memory is used as intermediate stage. Additionally such buffer may be feasible when a large block of data is assembled or disassembled (as required by a storage device), or when data must be delivered in a different order than that in which it is produced. Also a whole buffer of data is usually transferred sequentially (for example to hard disk), so buffering itself sometimes increases transfer performance. These benefits are present even if the buffered data are written to the buffer once and read from the buffer once.
A cache also increases transfer performance. A part of the increase similarly comes from the possibility that multiple small transfers will combine into one large block. But the main performance gain occurs because there is a good chance that the same datum will be read from cache multiple times, or that written data will soon be read. Cache's sole purpose is to reduce accesses to the underlying slower storage. Cache is also usually an abstraction layer that is designed to be invisible from the perspective of neighboring layers.
======================
)

























































































