Buffer and Cache
Buffer and Cache
Buffers are allocated by various processes to use as input queues, etc. Most of
the time, buffers are some processes' output, and they are file buffers. A
simplistic explanation of buffers is that they allow processes to temporarily
store input in memory until the process can deal with it.
The terms are not mutually exclusive and the functions are frequently
combined; however, there is a difference in intent. A buffer is a temporary
storage location where a large block of data is assembled or disassembled. This
may be necessary for interacting with a storage device that requires large
blocks of data, or when data must be delivered in a different order than that in
which it is produced, or merely desirable when small blocks are inefficient. The
benefit is present even if the buffered data is written to the buffer once and
read from the buffer once.
A cache, on the other hand, hopes that the data will be read from the cache
more often than it is written there. Its purpose is to reduce accesses to the
underlying storage.
Buffers are allocated by various processes to use as input queues, etc. Most of
the time, buffers are some processes' output, and they are file buffers. A
simplistic explanation of buffers is that they allow processes to temporarily
store input in memory until the process can deal with it.