z/OS MVS Programming: Extended Addressability Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Synchronizing the Initialization Process

z/OS MVS Programming: Extended Addressability Guide
SA23-1394-00

The caller of ASCRE might want to wait until the new address space is initialized (the point at which the initialization routine has finished processing and has returned to the system program) before starting to run the first program in the new address space. The system provides the caller with two ECBs — EAERIMWT and EAEASWT — that it can use for communication and synchronization between the creating program and the initialization routine. The address of these two ECBs is contained in the data area that the ODA parameter specifies. The format of the 24-byte output area appears earlier in this section, and the macro IEZEAECB maps the two ECBs within that data area. For the format of the ECBs, see the EAECB data area in See z/OS MVS™ Data Areas in the z/OS® Internet Library: &zosliburl;.

Use the ECBs as follows:
  • When the initialization routine gets control and completes all or part of its processing, it posts EAERIMWT (a "cross memory" POST) to notify the caller of ASCRE. If the initialization routine needs further communication with the creating program, it can wait on EAEASWT. The initialization routine can pass up to three bytes of information in the post code of the ECB.
    Note: To post EAERIMWT with a cross memory post, the initialization routine must supply the creating address space's ASCB address on the POST macro. The routine obtains the ASCB address from the creating program in the following manner:
    • The creating program obtains the ASCB address from PSAAOLD
    • The creating program places the ASCB address in a parameter string, and specifies the parameter string on the ASPARM parameter on the ASCRE macro
    • The initialization routine invokes the ASEXT macro to obtain the address of a copy of the parameter string.
  • If the caller needs to communicate back to the initialization routine, it posts EAEASWT, which the initialization routine is waiting on.

Figure 1 shows an example of a program creating a new address space that has PC services. The caller of ASCRE does not want PC routines in the new address space to be called from other address spaces before the cross memory environment is initialized and able to handle those requests.

IBM® recommends that your initialization routine post EAERIMWT and wait on EAEASWT. If the initialization routine posts EAERIMWT, but does not wait on EAEASWT, the system frees the ECBs prematurely. This action causes the system to abend the caller of ASCRE.
Figure 1. Synchronization of the address space creation process
ieaa5050
The initialization routine should use one of the following reason codes when it returns to the system program:
  • 0 — Continue with address space initialization
  • 4 — Terminate the address space.
If the initialization routine is going to return to the system program with the return code that requests that the new address space terminate, the routine should first notify the caller of ASCRE to allow the system to continue processing. To notify the caller:
  • The initialization routine can post EAERIMWT and wait on EAEASWT.
  • When the caller is posted, it can post EAEASWT to notify the initialization routine. Control returns to the system program.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014