Spooling
From Wikipedia, the free encyclopedia
In computer science, spooling refers to a process of transferring data by placing it in a temporary working area where another program may access it for processing at a later point in time. The term 'spool' is an acronym of 'Simultaneous Peripheral Off-line Output Listing.' This temporary working area could be a file or storage device, but probably not a buffer. Traditional uses of the term spooling apply to situations where there is little or no direct communication between the program writing the data and the program reading it. Spooling is often used when a device writes data at a speed different from the rate at which the target device reads it, which would allow a slower device to process it at its own rate. Data is only modified through addition or deletion at the ends of the area, i.e., there is no random access or editing.
It can also refer to a storage device that incorporates a physical spool, such as a tape drive.
The most common spooling application is print spooling. In print spooling, documents are loaded into a buffer (usually an area on a disk), and then the printer pulls them off the buffer at its own rate. Because the documents are in a buffer where they can be accessed by the printer, the user is free to perform other operations on the computer while the printing takes place in the background. Spooling also lets users place a number of print jobs in a queue instead of waiting for each one to finish before specifying the next one. Optionally it may also automatically generate banner pages, to identify and separate print jobs.
The temporary storage area to which e-mail is delivered by a Mail Transfer Agent and in which it waits to be picked up by a Mail User Agent is sometimes called a mail spool. Likewise, a storage area for Usenet articles may be referred to as a news spool. (On Unix-like systems, these areas are usually located in the /var/spool directory.) Unlike other spools, mail and news spools usually allow random access to individual messages.
Contents |
[edit] Origin of the term
| This article does not cite any references or sources. Please help improve this article by adding citations to reliable sources. Unverifiable material may be challenged and removed. (November 2008) |
"Spool" is supposedly an acronym for simultaneous peripheral operations on-line (although this is thought by some[weasel words] to be a backronym), or as for printers: simultaneous peripheral output on line. Early mainframe computers had, by current standards, small and expensive hard disks.
In the latter 1960s and early 1970s, computers handled punch cards, and spooling systems such as HASP, Grasp, and The Spooler found they could benefit batch programs by spooling card input and output. (Some centers directed punch card and printed output to tape for later processing. It has been suggested that the term 'spooling' may have derived from these reels or 'spools' of tape, although this etymology has not been sourced.)
[edit] The spooling mechanism
The entire key to spooling is asynchronous processing, where the program is not constrained by the speed of slow devices, particularly printers.[1]
Printers are relatively slow peripherals. In comparison, disc devices and particularly CPUs are orders of magnitude faster. Without spooling print data, the speed of program operation is constrained by the slowest device, commonly printers, forcing the program to wait for the mechanical motion of the printer. Professionals say the program is 'print bound'.[1]
For example, when a city prepares payroll checks, the actual computation may take a matter of minutes or even seconds, but the printing process might take hours. If the program printed directly, computing resources (CPU, memory, peripherals) would be tied up until the program was able to finish. The same is true of personal computers. Without spooling, a word processor would be unable to continue until printing finished. Without spooling, most programs would be relegated to patterns of fast processing and long waits, an inefficient paradigm.
[edit] Behind the scenes
A spooler contains two parts:
- an operating system extension to trap data destined for a printer and buffers it,
- a simple program that independently writes trapped data to the printer.
[edit] Without spooling
An application program may write print lines or pages intended for a slow physical printer. The operating system receives I/O requests (input/output), including print lines or pages. Without a spooler, the OS would allow data to pass to the printer and the application program would wait for completion before continuing.
[edit] With spooling
A spooling mechanism traps the I/O request, captures the output data, and releases the application to continue processing. As the application continues, the spooler writes the data to a disc file and, if it's not already running, it kicks off the other part of the spooler, the actual print routine. It reads the output lines and writes them to the printer, independent of the original application which may have already ended.
[edit] In practice
Spooling improves the multiprogramming capability of systems. Most programs require input and produce output. Without spooling, the number of tasks that could be multiprogrammed might be limited by the availability of peripherals; with spooling, a task doesn't need access to a real device.
Because disc drives are so much faster than printers, throughput radically improves by temporarily directing printer output to disc storage and retrieving it at leisure.[1]
[edit] See also
- Queue
- Spoolers:
- Berkeley printing system (lpr/lpd)
- CUPS
- Houston Automated Spooling Program (HASP), prominent in 1960s
- Job Entry Subsystem 2, a follower of HASP
- The Spooler, IBM DOS spooler, 1975-1980s
[edit] References
- ^ a b c The Spooler User Guide, L. Lundin, DataCorp of Virginia, 1977.
|
|||||
|
||||||||||||||||||||

