Spooling stands for Simultaneous Peripheral Off-time Output Listing, spools refers to a process of transferring data by placing it in a temporary working area where another program may access data at different rates.
The buffer provides a waiting section where data can rest while the slow devices catch up.
With spooling the disk is used as a very large buffer.
This buffer is a special area in memory or hard disk which is accessible to I/O devices.
Operating system does the following activities related to distributed environment.
§ OS handles I/O device data spooling as devices have different data access rates.
§ OS maintains the spooling buffer which provides a waiting station where data can rest while the slower device catches up.
§ OS maintains parallel computation because of spooling process as a computer can perform I/O in parallel fashion.
§ It becomes possible to have the computer read data from a tape, write data to disk and to write out to a tape printer while it is doing its computing task.
Advantages of Spooling:
§ The spooling operation uses a disk as a very large buffer.
§ Spooling is capable of overlapping I/O operation for one job with processor operations for another job.
§ A buffer is an area of main memory for holding data during input and output data transfers.
§ Buffering is the method of overlapping the computation of a job with its execution.
§ It temporarily stores input or output data in an attempt to better match the speed of two devices such as fast CPU and slow disk drive.
§ The idea is quite simple. After data has been read and the CPU is about the start operating on it, the input device is interacting to begin the next input immediately.
§ The CPU and the input device are then both busy.
§ When CPU is read for next data item, the input device will have finished reading it and so on.
§ Similarly, this can be done for output.
§ In this case, the CPU creates data that is put into a buffer until an output device can accept it.
Example of Buffering:
Spooling is great for some sorts of computer tasks, but it’s not appropriate for others.
Watching video on YouTube comes with the expectation that clicking “Play” will cause the video to begin playing immediately.
For this to work, the website sends small parts of the video when the page loads, and then starts sending the next parts of the video when the “Play” button is clicked.
These subsequent parts are queued up in a buffer so that the video plays smoothly even though it’s not fully downloaded when you start it.
Difference between Buffering and Spooling:
§ Spooling allows CPU to overlap the input of one job with the computation and output of other jobs whereas buffering overlaps input, output and processing of a single job.
§ Spooling is better than Buffering; the spooler may be reading the input of one job while printing the output of different job.