• Aucun résultat trouvé

The SPOOLER Command

Dans le document User's THEOS/OASIS (Page 149-155)

In a multi-user system there is a need to provide a means of controlling access to the printers attached to the computer. This is particularly important if only one printer is available. One of the benefits of a multi-user system over a single-user system is its ability to perform multiplejobs simultaneously. It would be most unfortunate if a printer created a time bottleneck because all users were waiting to use the printer. Fortunately, THEOS provides the spooling function which allows files specified for printing to be temporarily written to disk when the printer is busy.

When a spooled disk file is created, it is automatically assigned a filename by THEOS. The filenames are assigned in numerical order as they are created beginning with the number one. When the printer is available, each file is printed beginning with the first spooled file. In order to avoid unnecessarily occupying disk space, each file is erased after printing is completed.

CONTROL OF SPOOLER FUNCTIONS

Application software generally is written to automate operation of the spooler. For this reason our tutorial will be limited to discussing the commands related to activating and deactivating the spooler. For a discussion of all SPOOLER commands, refer to the THEOS docu-mentation.

If THEOS commands are executed at the operating system level such as LIST or FILELIST and the spooler is active, the function of the spooler is automatic. THEOS writes the information to a disk file.

If the printer is not busy, the file is immed~ately printed. If the printer is busy, the information remains in the file until the printer is available.

Use of THEOS's printer echo feature with the spooler is not recommended. Printer echo is the direct printing of a screen display by pressing ESC P RETURN. Use of this feature may result in misallo-cated disk space. If you want to use this feature, be certain that the spooler is not activated.

The format of the SPOOLER command is:

SPOOLER function

Function Purpose

INIT Initializes the spooler for use; must be performed before any of the spooler functions can be used.

This command requires a privilege level of five.

QUIT This command deactivates the spooler and requires a privilege level of five.

STOP Stops printing after the current report. This command is used to terminate the use of the spooler. Termination of printing in the middle of a report should be handled automatically by application sofware.

Figure 4.35. SPOOLER functions

Using The SPOOLER Commands

In order to use the spooler functions the following rules must be observed:

150 THEOS User's Handbook

• The device PRINTER1 must be attached.

• The file SYSTEM.SPOOLQUE must exist, preferably on a disk by itself. Early versions of THEOS (prior to ver-sion 5.6) caused spooled files to overwrite files on the disk where SYSTEM.SPOOLQUE was located.

• The SPOOLER INIT function must be performed.

• Execute all commands relating to the spooler from the main terminal attached to PORT1.

Note: The THEOS spooler only allows spooled files to be directed to the printing device attached as PRINTER!.

SINGLE-USER SPOOLING

It is possible to use the spooler in the single-user mode. Doing so frees the terminal for another task as soon as the spooled file is written to the disk. Assuming the rules outlined above have been followed, to use the spooler while in single-user mode execute the following steps:

• Be certain PRINTER1 is attached

• Be certain the file SYSTEM.SPOOLQUE is located on an active drive

• Enter the following command:

>SPOOLER INIT<RETURN>

Spool parameters: Queue=A, Copies=1, Nohold.

Spooler has form "A" mounted.

Spooler is waiting for work.

~ > ~

Tl-t.is message informs you that the spooler is ready for operation.

Caution: Using the spooler in single-user mode means that approximately 5K of working memory is taken away from that user's working memory. Many THEOS programs require more than 40K bytes for proper operation. If that is the case it is recommended that you use the spooler in multi-user mode to maximize memory for each user partition.

MULTI-USER SPOOLING

U sing the spooler in multi-user mode is a little more complex. To do so:

• Be certain PRINTER1 is attached

• Be certain the file SYSTEM.SPOOLQUE is located on an active drive

• The spooler must be loaded

• Use the SET MEMORY command to allocate memory for each user

• Allocate one additional memory partition for the spooler

To set up a two user system with spooler type:

r >A PRINTER1 PORTn<RETURN>

~

>LOAD SPOOLER<RETURN>

>SET MEM 211; SECOND MEMORY PARTITION<RETURN>

>SET MEM 33500 1; SPOOLER PARTITION<RETURN>

>SPOOLER INIT<RETURN>

Spool parameters: Queue=A, Copies=1, Nohold.

Spooler has form "A" mounted.

Spooler .. is waiting for work.

>START2<RETURN>

\,.>

Line 1 ensures that a printer was attached to the port of your choice. Before attaching the printer, be certain that the desired port is active and has the baud rate set to match your printer's baud rate. Line 2 loads the spooler. Lines 3 and 4 allocate memory for the second user and spooler partitions. After the spooler is initialized, the second user partition is activated using the START command.

To set up a five user system with spooler type:

>ATTACH PRINTER1 PORTn<RETURN>

>LOAD SPOOLER<RETURN>

>SET MEM 211<RETURN>

>SET MEM 31 2<RETURN>

>SET MEM 4 1 3<RETURN>

>SET MEM 51 4<RETURN>

>SET MEM 63500 5<RETURN>

>SPOOLER INIT<RETURN>

Spool parameters: Queue=A, Copies=1, Nohold.

Spooler has form "A" mounted.

Spooler is waiting for work.

>START 2<RETURN>

>START 3<RETURN>

>START 4<RETURN>

>START 5<RETURN>

152 THEOS User's Handbook

Line one attaches a printer to the port of your choice. Line two loads the spooler module. The following entries allocate memory for each user and spooler partition. The spooler is then initialized and each user partition started.

Stopping The Spooler In Single-User Mode

The following command terminates the spooling function while in the single-user mode:

>SPOOLER QUIT <RETURN>

>

This command can only be executed if the spooler is inactive. A privilege level of five is required to execute this command.

Note: In addition to terminating spooler operation, issuing a SPOOLER QUIT command causes the printer being used by the spooler to be detached from the system. If this printer is to be used after issuing the command, it must be reattached by typing:

>A PRINTER PORTn<RETURN>

>

Stopping The Spooler In Multi-User Mode

The spooler is generally deactivated in the multi-user mode when bringing the system down to single-user operation. It is mandatory that these commands be executed from the main terminal or the terminal attached to POR Tl because during the process of bringing the system down to single user mode, all user partitions except the main terminal attached to PORTI will be deactivated.

Using our five user system example, we'll illustrate stopping the spooler and bringing the system down to single -user mode. From the main terminal type:

>SPOOLERSTOP<RETURN>

>SPOOLER QUIT<RETURN>

>STOP 6<RETURN>

>SET MEM 6<RETURN>

>STOPS<RETURN>

>SET MEM S<RETURN>

>STOP 4<RETURN>

>SET MEM 4<RETURN>

>STOP 3<RETURN>

>SET MEM 3<RETURN>

>STOP2<RETURN>

>SET MEM 2<RETURN>

>UNLOAD SPOOLER<RETURN>

The SPOOLER STOP command is used in case the spooler is printing a report at this time. This command tells the spooler to quit printing after the current report has finished printing.

The SPOOLER QUIT command is used to deactivate the spooler.

Each user partition is then stopped and the memory partitions deacti-vated. The spooler module is then unloaded.

Note: If all users on the system are not logged off when the memory partitions are stopped, the error message "Partition is still active" is displayed. That memory partition remains active until the user has logged off and the STOP command re-executed.

SUMMARY

The purpose of the THEOS spooler is to allow sharing of a common printer in a multi-user environment thereby eliminating a time bottleneck which may occur as each user accesses the printer.

Examples illustrating the use of the spooler in single and multi-user mode have been provided. As we will see in chapters six and seven EXECs can be used in both single and multiuser modes to automati-cally activate the spooler.

154 THEOS User's Handbook

Dans le document User's THEOS/OASIS (Page 149-155)