A print symbiont is a type of device symbiont that processes data for output to printers and printing terminals. In the operating system, the existence of a print symbiont process is linked to the existence of at least one print execution queue that is started. A default print symbiont is supplied with OpenVMS; however, other print symbionts are available as well.
The symbiont is specified upon queue initialization with the INIT/QUEUE /PROCESSOR command.
Print symbionts perform the following functions:
- Reading the data from disk
- Formatting the data
- Sending the data to the printing device
- Composing separation pages (flag, burst, and trailer pages) and inserting them into the data stream for printing
The print symbiont includes the following major components:
- PSM routines that are used to modify the print symbiont
- Routines that implement input, format, and output services in the print symbiont
- Routines that implement the internal logic of the print symbiont
The print symbiont is implemented using the Symbiont Services facility. This facility provides communication and control between the job controller and symbionts through a set of Symbiont/Job Controller Interface routines (SMB routines). All of these routines are contained in a shareable image with the file specification SYS$SHARE:SMBSRVSHR.EXE.
Print Symbiont Process
The print symbiont process runs as a detached process. The job controller creates the print symbiont process by calling the $CREPRC system service; it does this whenever either of the following conditions occurs:
- A print execution queue is started (from the stopped state) and no symbiont process is running the image specified with the START/QUEUE command.
- A print execution queue is started by means of the DCL command START/QUEUE. Use the /PROCESSOR qualifier with the START/QUEUE command to specify the name of the symbiont image that is to service an execution queue; if you omit /PROCESSOR, then the default symbiont image is PRTSMB.
Currently existing symbiont processes suited to a print execution queue cannot accept additional devices; that is, the symbionts have no more available streams. In such a case, the job controller creates another print symbiont process.
Symbiont vs Job Controller
The job controller uses the information specified on the PRINT command line to determine the following:
- Which queue to place the job in (/QUEUE, /REMOTE, /LOWERCASE, and /DEVICE)
- How many copies to print (/COPIES and /JOB_COUNT)
- Scheduling constraints for the job (/PRIORITY, /AFTER, /HOLD, /FORM, /CHARACTERISTICS, and /RESTART)
- How and whether to display the status of jobs and queues (/NOTIFY, /OPERATOR, and /IDENTIFY)
The print symbiont, on the other hand, interprets the information supplied with the qualifiers that specify this information:
- Whether to print file separation pages (/BURST, /FLAG, and /TRAILER)
- Information to include when printing the separation pages (/NAME and /NOTE)
- Which pages to print (/PAGES)
- How to format the print job (/FEED, /SPACE, and /PASSALL)
- How to set up the job (/SETUP)
The print symbiont, not the job controller, performs all necessary device-related functions. It communicates with the printing device driver. For example, when a print execution queue is started (by means of START/QUEUE/ON=device) and the stream is established between the queue and the symbiont, the symbiont parses the device name specified by the /ON qualifier in the START/QUEUE command, allocates the device, assigns a channel to it, obtains the device characteristics, and determines the device class. In versions of the operating system prior to Version 4.0, the job controller performed these functions.
The print symbiont's output routine returns an error to the job controller if the device class is neither printer nor terminal.
The job controller deals with units of work called jobs, while the print symbiont deals with units of work called tasks. A print job can consist of several print tasks. Thus, in the processing of a print job, the job controller's role is to divide a print job into one or more print tasks, which the symbiont can process. The symbiont reports the completion of each task to the job controller, but the symbiont contains no logic to determine that the print job as a whole is complete.
In the processing of a print task, the symbiont performs three basic functions: input, format, and output. The symbiont performs these functions by calling routines to perform each function.
The following steps describe the action taken by the symbiont in processing a task:
- The symbiont receives the print request from the job controller and stores it in a message buffer.
- The symbiont searches its list of input routines and selects the first input routine that is applicable to the print task.
- The input routine returns a data record to the symbiont's input buffer or in a buffer supplied by the input routine.
- Data in the input buffer is moved to the symbiont's output buffer by the formatting routines, which format it in the process.
- Data in the output buffer is sent to the printing device by the output routine.
- When an input routine completes execution, that is, when it has no more input data to process, the symbiont selects another applicable input routine. Steps 3, 4, and 5 are repeated until all applicable input routines have executed.
- The symbiont informs the job controller that the task is complete.
Most of the input routines execute in a specified sequence. This sequence is defined by the symbiont's main control routine. You cannot modify this main control routine; thus, you cannot modify the sequence in which symbiont routines are called.
The input routines that do not execute in sequence are called "demand input routines." These routines are called whenever the service they provide is required and include the page header, page setup, and library module input routines.
The symbiont can perform input, formatting, and output functions asynchronously; that is, the order in which the symbiont calls the input, formatting, and output routines can vary. For example, the symbiont can call an input routine, which returns a record to the input buffer; it can then call the format routine, which moves that record to the output buffer; and then it can call the output routine to move that data to the printing device. This sequence results in the movement of a single data record from disk to printing device.
On the other hand, the symbiont can call the input and formatting routines several times before calling the output routine for a single buffer. The buffer can contain one or more formatted input records. In some cases an output buffer might contain only a portion of an input record.
In this way the symbiont can store input records; then call the format routine, which moves one of those records to the output buffer; and finally call the output routine, which moves that data to the printing device. Note, however, that the formatting routine must be called once for each input record.
Similarly, the symbiont can store several formatted records before calling the output routine to move them to the printing device.
The symbiont requires this flexibility in altering the sequence in which input, format, and output routines are called for reasons of efficiency (high rate of throughput) and adaptability to various system parameters and system events.
The value specified with the call to PSM$PRINT determines the maximum size of the symbiont's output buffer, which cannot be larger than the value of the system parameter MAXBUF. If the buffer is very small, the symbiont might need to call its output routine one or more times for each record formatted. If the buffer is large, the symbiont stores several formatted records before calling the output routine to move them to the printing device.