Open In App

What exactly Spooling is all about?

Last Updated : 20 Apr, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Introduction

SPOOL is an acronym for simultaneous peripheral operations on-line. It is a kind of buffering mechanism or a process in which data is temporarily held to be used and executed by a device, program or the system. Data is sent to and stored in memory or other volatile storage until the program or computer requests it for execution.

Need of Spooling

Peripheral equipment such as printers and punch card readers are often slow relative to the performance of the rest of the system, creating a bottleneck in the I/O process. This is where spooling comes in. Spooling resolves this by accumulating data, instructions, and processes from multiple sources in a request queue, which is then processed in a first-in, first-out (FIFO) manner.

How Does Spooling Work:

Spooling can be implemented using the computer’s physical memory, buffers, or device-specific interrupts. The most common applications of spooling are found in I/O devices like keyboards, printers, and mice. For example, when a document is sent to a printer, it is first stored in the printer’s spooler or memory. When the printer is ready, it fetches the data from the spool and prints it.

Batch processing systems also use spooling to maintain a queue of ready-to-run jobs, which can be started as soon as the system has the resources to process them. Additionally, spooling is capable of overlapping I/O operation for one job with processor operations for another job, allowing multiple processes to write documents to a print queue without waiting and resume with their work.

Applications/Implementations of Spool:

1) The most common can be found in I/O devices like keyboard printers and mouse. For example, In printer, the documents/files that are sent to the printer are first stored in the memory or the printer spooler. Once the printer is ready, it fetches the data from the spool and prints it.

Ever experienced a situation when suddenly for some seconds your mouse or keyboard stops working? Meanwhile, we usually click again and again here and there on the screen to check if its working or not. When it actually starts working, what and wherever we pressed during its hang state gets executed very fast because all the instructions got stored in the respective device’s spool.

2) A batch processing system uses spooling to maintain a queue of ready-to-run jobs which can be started as soon as the system has the resources to process them.

3) Spooling is capable of overlapping I/O operation for one job with processor operations for another job. i.e. multiple processes can write documents to a print queue without waiting and resume with their work.

4) E-mail: an email is delivered by a MTA (Mail Transfer Agent) to a temporary storage area where it waits to be picked up by the MA (Mail User Agent)

5) Can also be used for generating Banner pages (these are the pages used in computerized printing in order to separate documents from each other and to identify e.g. the originator of the print request by username, an account number or a bin for pickup. Such pages are used in office environments where many people share the small number of available resources).

 

About the Author:

Ekta is a  very active contributor on Geeksforgeeks. Currently studying at Delhi Technological University. She has also made a Chrome extension for  www.geeksquiz.com to practice MCQs randomly. She can be reached at  github.com/Ekta1994

If you also wish to showcase your blog here, please see GBlog for guest blog writing on GeeksforGeeks.
 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads