Spooler Programmer's Guide
Introduction to the Spooler Subsystem
Spooler Programmer’s Guide—522287-002
1-21
Virtual Devices
associated print process that performs the task of retrieving and printing jobs on that
device. Refer to Section 3, Using the Spooler Print Procedures, Print Processes, and
Perusal Processes, for more information on using print processes.
Virtual Devices
When a device becomes available, the supervisor tells the print process associated
with the device to retrieve and print the next job. It then becomes the responsibility of
the print process to access the spooled data and issue a succession of Guardian file-
system WRITE[X] procedure calls to the correct device.
A print process can perform a function with the spooled data other than writing it to a
device. If, for example, you want to perform a statistical analysis of numerical data that
has been spooled from an application, you can write a print process that retrieves the
spooled data and performs the desired analysis. To do this you must declare a
fictitious (virtual) device by using the Spoolcom DEV command. Then assign the print
process to control that device.
Device Ownership
Physical devices that are declared as part of the spooler subsystem can be accessed
by other processes when they are not being used by the spooler. A device that can be
accessed by other processes is called a shared device.
The print process opens a shared device when the spooler wants to print a job on the
device. When the job is finished printing, the print process closes the device to allow
access to the device by other processes. The print process competes with all other
processes for access to a shared device.
An exclusive device, on the other hand, is kept open all the time, preventing any other
process from gaining access.
If a print process controls only shared devices, it runs only when one of the devices is
actually being used by the spooler. If a print process controls an exclusive device, it
must run all the time to keep the device open.
Device Queues
Associated with each device is a device queue, which is simply a list of jobs waiting for
that device in the order that they are scheduled to print. The device queue for a
particular device contains jobs routed to all locations connected to the device. A job is
added to a device queue whenever the job becomes ready to print.
Device queues are not queues in the usual sense of the term, because jobs are not
always added to device queues on a first-in, first-out (FIFO) basis. The default
queueing method orders the print jobs in the device queue based on the length of the
incoming job and how long the other jobs have been in the queue.