z/OS® uses
several types of supervisor controls to enable multiprogramming.
These supervisor controls include:
- Interrupt processing
- Multiprogramming requires that there be some technique for switching control
from one routine to another so that, for example, when routine A must wait
for an I/O request to be satisfied, routine B can execute. In z/OS, this switch
is achieved by interrupts, which are events that alter the sequence
in which the processor executes instructions. When an interrupt occurs, the
system saves the execution status of the interrupted routine and analyzes
and processes the interrupt.
- Creating dispatchable units of work
- To identify and keep track of its work, the z/OS operating system represents each unit
of work with a control block. Two types of control blocks represent dispatchable
units of work: Task control blocks or TCBs represent tasks executing
within an address space; service request blocks or SRBs represent higher
priority system services.
- Dispatching work
- After interrupts are processed, the operating system determines which
unit of work (of all the units of work in the system) is ready to run and
has the highest priority, and passes control to that unit of work.
- Serializing the use of resources
- In a multiprogramming system, almost any sequence of instructions can
be interrupted, to be resumed later. If that set of instructions manipulates
or modifies a resource (for example, a control block or a data file), the
operating system must prevent other programs from using the resource until
the interrupted program has completed its processing of the resource.
Several
techniques exist for serializing the use of resources; enqueuing and locking are
the most common (a third technique is called latching). All users can
use enqueuing, but only authorized routines can use locking to serialize the
use of resources.