GDDM V3R2 Base Application Programming Guide
Previous topic | Next topic | Contents | Index | Contact z/OS | Library | PDF | BOOK


Task management

GDDM V3R2 Base Application Programming Guide
SC33-0867-01



The "Example: Program using two operator windows" in topic 22.2.2 showed how a single GDDM application could use windowing in its dialog with the terminal user, to present separate functions of the application, each in an operator window. You may recall that the application used the DSOPEN call to open the real device, and two WSCRT calls to open two operator windows. A subroutine was then called for each window. The subroutine contained a DSOPEN, that opened a virtual device for each operator window.

You can use the same windowing principles to write your own task manager program. The GDDM-supplied example task manager (ADMUTMT for TSO, ADMUTMV for VM/CMS) is an example of such a program. The task manager uses DSOPEN to open the real device, and WSCRT and the other windowing calls to create and control an operator window for each application program. Subsequent DSOPEN calls in each application program open one or more virtual devices, which are associated with the operator windows created by the task manager. This is illustrated in Figure 133.


   PICTURE 65          

Figure 133. Task manager with several applications


The task manager manages the display device screen and other resources. In addition, the task manager must either use the task-management facilities of the operating system, or use its own pseudotasking facilities (TSO has full task-management facilities but CMS does not). The system tasking or pseudotasking executes each program in a separate sub-task.

GDDM enables several application programs to share the screen by allowing the task manager to intervene in the execution of the program's input/output calls. When each operator window is created, the task manager specifies (in the first array element of the last parameter of the WSCRT call) the address of a coordination exit routine. This runs in the application program subtask, and is invoked by GDDM whenever the application calls a function that requires input/output for the terminal-an ASREAD call, typically, as shown in Figure 134.


   PICTURE 66          

Figure 134. The coordination exit routine


The numbers in the figure represent the following events:

  1. An input/output call is issued by the application, causing GDDM to invoke the coordination exit routine.
    
    
  2. The exit routine, when invoked, must post the task-manager task and wait. The task manager must then call WSIO, the coordinated output/input call. The WSIO call updates all the windows on the screen. WSIO also returns the identifier of the topmost window on the screen. The task manager uses this to find out which subtask to post. It then posts that subtask and waits.
    
    
  3. When the task manager posts the subtask, control passes back to the coordination exit routine, which in turn returns control to GDDM.
    
    
  4. Control then returns to the ASREAD (or other application input/output call). GDDM completes the processing of this call, and pass control back to the application program. Any input data entered by the terminal user is then available to the application.
    
    

When the application terminates, normally or abnormally, control is passed to the task manager, which typically calls WSIO to find out from the terminal user what to do next.

The purpose of the coordination exit routine is to switch control from the subtask to the main task, or the other way round. There is a direction parameter to tell it which way to switch.

Subtopics:

Go to the previous page Go to the next page



Copyright IBM Corporation 1990, 2012