数据库缓冲池
When several blocks need to be transferred from disk to main memory and all the block addresses are known, several buffers can be reserved in main memory to speed up the transfer.
当需要将几个块从磁盘传输到主存储器并且所有块地址已知时,可以在主存储器中保留几个缓冲区以加快传输速度。
When one buffer is being used for reading or writing, at that time the CPU can process data in the other buffer because an independent disk (I/O) processor (controller) exists when once it started it can proceed to transfer a block of data between memory and disk independent of and in parallel to CPU processing.
当一个缓冲区用于读取或写入时,那时CPU可以处理另一缓冲区中的数据,因为一旦启动它就存在一个独立的磁盘(I / O)处理器(控制器),它就可以继续传输数据块在内存和磁盘之间独立于CPU处理并与之并行。
How two processed in parallel are shown in the following figure?
下图显示了如何并行处理两个?
In the above figure Processes, A and B are running concurrently in an interleaved fashion whereas processes C and D are running concurrently in a parallel fashion.
在上图中,进程A和B以交错方式同时运行,而进程C和D以并行方式同时运行。
When single processes control multiple processes,parallel execution is not possible.
当单个进程控制多个进程时,无法并行执行。
However, the process can still run concurrently in an interleaved way. Buffering is most useful when processes can run concurrently in parallel fashion, either because a separate disk I/O processor is available or because multiple CPU processors exist.
但是,该过程仍可以以交错方式并发运行。 当进程可以并行方式并行运行时,缓冲是最有用的,这是因为可以使用单独的磁盘I / O处理器,或者因为存在多个CPU处理器。
The following figure basically illustrates how reading and processing can proceed in parallel when the time required to process a disk block in memory is less than the time required to read the next block and fill a buffer.
下图基本说明了在内存中处理磁盘块所需的时间少于读取下一个块并填充缓冲区所需的时间时,如何并行进行读取和处理。
Processing of CPU starts when the transfer of a block of data to main memory is completed and at the same time next block where the disk I/O processor reading or writing will transfer this block to the different buffer.
当一个数据块到主存储器的传输完成时,CPU的处理开始,与此同时,磁盘I / O处理器读取或写入的下一个块会将这个块传输到另一个缓冲区。
This technique is basically known as Double Buffering and it is basically used to read a continuous stream of blocks of data from disk to memory.
这种技术基本上被称为双缓冲,并且基本上用于从磁盘到内存读取连续的数据块流。
Double Buffering permits continuous reading or writing of data on consecutive disk on consecutive disk blocks, which eliminates the seek time and rotational delay for all but the first block transfer.
Double Buffering允许连续读取或写入连续磁盘块上连续磁盘上的数据,从而消除了除了第一个块传输之外的所有磁盘的寻道时间和旋转延迟。
The most important thing in this is that the data is always ready for processing which helps in reducing the waiting time.
最重要的是,数据始终准备就绪,可以进行处理,这有助于减少等待时间。
翻译自: https://www.includehelp.com/dbms/buffering-of-blocks.aspx
数据库缓冲池