Spooling is a process in which data is temporarily held to be used and executed by a device, program, or system. It is a specialized form of multi-programming for copying data between different devices. Spooling makes use of a buffer known as SPOOL, which is used to hold off jobs and data until the device in which the SPOOL is created is ready to use and execute the job or operate on the data. The SPOOL is executed in a First In First Out (FIFO) order. Spooling can be implemented using the computer’s physical memory, buffers, or device-specific interrupts. The most common use of spooling is printing, where documents formatted for printing are stored in a queue at the speed of the computer, then retrieved and printed at the speed of the printer. Multiple processes can write documents to the spool without waiting, and can then perform other tasks, while the "spooler" process operates the printer.
The key features of spooling are:
- Buffer: An area in RAM or on the hard drive designated to hold input and output on their way in or out of the system.
- SPOOL: A buffer used to hold off jobs and data until the device in which the SPOOL is created is ready to use and execute the job or operate on the data.
- FIFO: The SPOOL is executed in a First In First Out (FIFO) order.
Spooling is used to mediate access to punched card readers and punches, magnetic tape drives, and other slow, sequential I/O devices. It allows the application to run at the speed of the CPU while operating peripheral devices at their full rated speed. A batch processing system uses spooling to maintain a queue of ready-to-run tasks, which can be started as soon as the system has the resources to process them.