About the difference between the buffer and cache

1. Cache: cache, a cache, the smaller is located between the CPU and main memory of a memory capacity but fast, because the CPU is much faster than the speed of the main memory, the CPU reads the data from the memory need to wait a long time, and Cache CPU holds just used the data part of the data or recycled, then read the data from the Cache will be faster, reducing CPU wait time and improve the performance of the system. Cache file is not cached, but the cache block (block of an I / O read and write minimum cell); 

Cache: usually used in the I / O request on, if multiple processes to access a file, the file can be read into the Cache, so the next process to obtain control over the CPU and access the file read directly from the Cache, improve system performance.

2. Buffer: transferring data between buffers, different devices or devices for storing priority speed is not synchronized; can reduce the time required to wait for inter-process communication by the buffer, when the fast storage device and stored in slow speed devices when communicating, storing data or slow data stored in the first buffer, to a certain degree of quick re-read data buffer storage device in the storage device during a fast CPU can do other things.

Buffer: generally used in written to disk , for example: a process requiring multiple fields are read, when all the required fields before being read into the field will have been read into the first buffer.

   

  

Guess you like

Origin www.cnblogs.com/liuxia912/p/10962376.html