Spooler Programmer's Guide
Using the Spooler Print Procedures, Print
Processes, and Perusal Processes
Spooler Programmer’s Guide—522287-002
3-8
Combining Data Retrieval With Spooler
Communication
Combining Data Retrieval With Spooler Communication
A print process must perform the tasks of retrieving and printing jobs and responding to
supervisor messages concurrently. This can be accomplished in any manner that you
find convenient. The only limitation is that a print process must respond to a
supervisor message within 10 minutes. However, it is important that the print process
respond as quickly as possible because the supervisor cannot do any useful work until
it gets a response.
To maximize print process responsiveness to Spoolcom commands, however, the file
to the supervisor should be checked for completion following the writing of every line of
data. HP recommends that you use the following procedure:
1. Open each device with nowait I/O. After each write to a device, monitor
completion on any file with AWAITIO[X].
2. If a device has finished, the print process calls PRINTREAD to get the next line of
data for the job printing on that device and starts an I/O operation on the device.
3. If the file to the supervisor finishes, the print process calls PRINTCOMPLETE and
PRINTREADCOMMAND to obtain the message and executes the supervisor
instruction.
After executing the supervisor instruction, the print process loops back to AWAITIO[X].
Debugging Print Processes
To debug a print process using the interactive debugging facility Debug (described in
the Debug Manual), the subcommand DEBUG is specified at the time the print process
is initialized with the Spoolcom PRINT command:
)PRINT $trial, FILE $yrvol.yrsub.pproc, PRI 145, DEBUG
The DEBUG subcommand causes the print process to run in Debug mode, which has
two effects:
The print process immediately enters the Debug state upon being started by the
supervisor. The Debug facility prompts the terminal where the supervisor was run.
The supervisor does not time out the print process if the print process fails to
respond to a message within 10 minutes.
To interactively debug a print process, follow this procedure:
1. Coldstart or warmstart a spooler, initializing the print process with the DEBUG
subcommand.
Note. As long as a job is being printed, there is always an operation on the device outstanding
after a supervisor instruction has been executed.
Note. Start a separate spooler dedicated solely to debugging your print process. Because
the supervisor waits indefinitely for message responses from a print process in Debug
mode, the spooler halts when a print process is being debugged.