Open In App

Spooling in Operating System

In the Operating System, we had to provide input to the CPU, which then executed the instructions and returned the output. However, there was a flaw in this strategy. In a typical situation, we must deal with numerous processes, and we know that the time spent on I/O operations is very large in comparison to the time spent by the CPU on instruction execution. So, in the old approach, one process will provide input using an input device, and the CPU will be idle during this time. The instruction is then carried out by the CPU, and the output is once more sent to an output device while the CPU is still in an idle state. The following process begins its execution after displaying the output. As a result, the CPU sits idle the majority of the time, which is the worst situation for operating systems. Spooling is a notion that is relevant in this situation.

Spooling

Spooling is an acronym for simultaneous peripheral operation online. Spooling is the process of temporary storage of data for use and execution by a device, program, or system. Data is sent to and stored in main memory or other volatile storage until it is requested for execution by a program or computer. Spooling makes use of the disc as a large buffer to send data to printers and other devices. It can also be used as an input, but it is more commonly used as an output. Its primary function is to prevent two users from printing on the same page at the same time, resulting in their output being completely mixed together. It prevents this  because it uses the FIFO(First In First Out) strategy to retrieve the stored jobs in the spool, and that creates a synchronization preventing the output to be completely mixed together.

It also aids in the reduction of idle time, as well as overlapped I/O and CPU. Simple forms of file management are frequently provided by batch systems. The access to the file is sequential. Batch systems do not necessitate the management of time-critical devices.

 

How Spooling Works in Operating Systems?

Example

 

Advantages

Disadvantages

Article Tags :