缓冲 高速缓存 假脱机_缓冲和假脱机之间的区别

缓冲 高速缓存 假脱机

To improve the system performance and efficiency of the computer by overlapping Input/output and processing there are two approaches: Buffering and Spooling.

为了通过重叠输入/输出和处理来提高计算机的系统性能和效率,有两种方法: 缓冲和假脱机。

1)缓冲 (1) Buffering)

In the main memory, buffer is a region which is used to store or hold the data temporarily that is being transmitted either between two devices or between a device or an application, it means buffer temporarily stores data that is being. The act of storing data or information for a shot time in the buffer is called buffering.

在主存储器中,缓冲区是一个区域,用于临时存储或保存在两个设备之间或在设备或应用程序之间传输的数据,这意味着缓冲区临时存储正在存储的数据。 将数据或信息存储在缓冲区中的时间称为缓冲区。

  • It is a technique of overlapping I/O and processing of single job. After data has been read and CPU is about to start operating on it the input devices are instructed to begin the next input immediately.

    这是重叠I / O和处理单个作业的技术。 读取数据并且CPU将开始对其进行操作后,将指示输入设备立即开始下一个输入。

  • By the time that the CPU is ready for the next data item, the input device will have finished reading it.

    当CPU准备好接收下一个数据项时,输入设备将完成读取操作。

  • The CPU can then begin processing the newly read data while input device start to read following data. Similarly, this can be done for O/P. In this case, CPU creates data that is put into a buffer until an output device can accept it.

    然后,CPU可以开始处理新读取的数据,同时输入设备开始读取后续数据。 同样,可以对O / P执行此操作。 在这种情况下,CPU将创建数据放入缓冲区,直到输出设备可以接受为止。

For example, when we download a video or audio file, some part of the downloaded file is placed in the buffer and then played. When that clip is played, the device continuously downloads the file and places it into the buffer.

例如,当我们下载视频或音频文件时,已下载文件的一部分会放在缓冲区中,然后播放。 播放该剪辑时,设备会连续下载文件并将其放入缓冲区。

缓冲的用途 (Uses of Buffering)

  • It resolves the problem of speed mismatch between two devices, between which the data is transmitted.

    它解决了在两个设备之间传输数据的速度不匹配的问题。

  • Before sending or receiving it manipulates data. The large message is fragmented into the small fragments or packets and transmitted over the network. At the receiving end, these packets are accumulated in the buffer and reassembled to form the complete large message.

    在发送或接收之前,它会处理数据。 大消息被分为小片段或数据包,并通过网络传输。 在接收端,这些数据包会在缓冲区中累积并重新组合以形成完整的大消息。

  • It also supports copy semantics that is the version of data in the buffer and at the time of system call both should be same is guaranteed to be the version of data at the time of system call irrespective of any change to data in the buffer.

    它还支持复制语义,该语义是缓冲区中数据的版本,并且在系统调用时,两者应相同,并且无论缓冲区中的数据有何变化,都应保证是系统调用时的数据版本。

2)假脱机 (2) Spooling)

It is the process in which jobs from the cars are read directly onto the disk and the location of that card in the disk is recorded in a table by the Operating System. When that job is required for execution, it is read from the disk.

在此过程中,汽车作业直接被读到磁盘上,而操作系统中该卡在磁盘中的位置被记录在一个表中。 当需要执行该作业时,将从磁盘读取该作业。

Similarly, when the job requires a printer to output a line, that particular line is copied onto the disk and system buffer and after job, output is read from the disk and printed by the printer.

同样,当作业需要打印机输出一行时,该特定行将被复制到磁盘和系统缓冲区上,而作业完成后,将从磁盘读取输出并由打印机进行打印。

spooling in OS


Spooling

假脱机

Why it is called as Spooling (simultaneous peripheral operation online)?

为什么将其称为假脱机(同时在线外围设备操作)?

By spooling more than one input and output devices can interact with disk simultaneously and provide an impression that these devices interact directly with CPU, so it is called simultaneous peripheral operation online.

通过假脱机处理,多个输入和输出设备可以同时与磁盘交互,并给人一种印象,即这些设备直接与CPU交互,因此称为在线同时外围设备操作

Spooling increases the performance of system and also leads to multiprogramming. The specification for spooling are some disk space and some tables but it makes busy both the CPU and I/O devices as much as possible.

假脱机可提高系统性能,并导致多重编程。 假脱机的规范是一些磁盘空间和一些表,但它会使CPU和I / O设备尽可能地繁忙。

缓冲和假脱机之间的区别 (Differences between Buffering and Spooling)

  1. Spooling can handle the I/O of one job as well as computation of another job at the same time while buffering handles I/O of one job along with its computation.

    假脱机可以同时处理一个作业的I / O和另一个作业的计算,而缓冲则可以处理一个作业的I / O及其计算。

  2. Spooling is an acronym for Simultaneous Peripheral Operation online while buffering is not an acronym.

    假脱机是在线同时外围设备操作的首字母缩写,而缓冲不是首字母缩写。

  3. Spooling is more efficient as it can overlap processing two jobs at a time but buffering is less efficient because it overlaps input/output of one job with the execution of the same job.

    假脱机效率更高,因为它可以一次重叠处理两个作业,但是缓冲效率较低,因为它会使一个作业的输入/输出与同一作业的执行重叠。

  4. Spool uses the disk as a huge buffer whereas buffer is a limited area in main memory.

    假脱机将磁盘用作巨大的缓冲区,而缓冲区是主内存中的有限区域。

References:

参考文献:

翻译自: https://www.includehelp.com/operating-systems/buffering-vs-spooling.aspx

缓冲 高速缓存 假脱机

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值