Unformatted text preview: f
data from/to a disk is much faster than reading/writing from/to a slow I/O device
resulting in considerable reduction in CPU idle time during I/O operations
involving slow devices.
In most computer systems, special low-cost I/O processors are used for spooling
the input data from a slow input device on to the disk or for outputting the spooled
output data from the disk on to the slow output device. These I/O processors
function independent of the main processor (CPU). This enables the main highspeed, expensive CPU to be fully devoted to main computing jobs. The process of spooling is transparent to the user programs. In general, spooling makes better use
of both the main memory and the CPU.
Dealing with Mutually Exclusive I/O Devices
There are several I/O devices that have to be used in dedicated mode for correct
system operation. Such devices are called mutually exclusive devices. Printer is a
typical example of such a device. For effective utilization of such devices, an
operating system often converts them into non-mutually exclusive virtual devices
by using spooling. For this, the operating system creates a special process, called a
daemon, and a special directory, called a spooling directory. Now when a process
makes a request to use the printer, instead of allocating the printer to the process,
the operating system opens a file for the process's output data in the spooling
directory, which is stored on the disk. All output data to be printed on the printer
by the process is written in this file. The file ii closed when the process completes
printing. The daemon then actually prints the file from the disk on to the printer.
The daemon is the only process having permission to print the files in the spooling
directory on to the printer. By protecting the printer against direct use by the users,
the problem of having someone keeping it open unnecessarily long is eliminated.
Printer is not the only device that can benefit from spooling in this manner. For
example, file transfer over a network often uses a network daemon. To send a file
somewhere, the system puts it in a network spooling directory on the disk. Later
on, the network daemon takes it out from the dire...
View Full Document
This document was uploaded on 04/07/2014.
- Spring '14