Pause elements and pause element tokens

A pause element (PE) is a system-managed object used to pause and release a work unit, which can be either a task or SRB. Like an ECB, a PE is used by the system to control whether or not a work unit is dispatchable. You can use a PE, like an ECB, to prerelease a work unit before it is paused. There are, however, significant differences between an ECB and a PE Table 1 compares the two:

Table 1. Pause Element (PE) and Event Control Block (ECB)
Pause Element (PE) Event Control Block (ECB)
Managed by the system. Managed by application programs.
Identified by a pause element token (PET). Identified by a simple address.
Cannot be reused once invalidated by an asynchronous ABEND. Can be reused after a task is removed from the wait state by an asynchronous ABEND, although reuse requires very complicated programming.
To prevent errors related to reuse, a PET can be used only once to identify a PE. Once a task is paused and released, an updated PET is needed to identify the PE. The system returns the updated PET to the caller through the Pause or Transfer service. There is no control on the reuse of an ECB; the same ECB address can be used over and over.
PEs are allocated and deallocated through calls to system services. ECBs are allocated by application programs.
The total number of PEs available to all unauthorized programs in a system is limited to 130560. The system imposes no limits on the number of ECBs.
PEs are not directly addressable through PETs. The user of a PE does not know its actual address and cannot modify it except through the use of system services. ECBs can be modified at will by application programs.

A PE allocated by an unauthorized caller can be used to pause and release any work unit in the caller's home address space. An unauthorized caller cannot pause or release using a PE allocated with auth_level=IEA_AUTHORIZED or pause_element_auth_level=IEA_AUTHORIZED.

When a PE is allocated with auth_level=IEA_AUTHORIZED (callable services IEAVAPE and IEA4APE) or pause_element_auth_level=IEA_AUTHORIZED (callable services IEAVAPE2 and IEA4APE2), the PE can be used to pause and release any task or SRB in the system. The same PE can be used, for example, to pause a task in address space 10. After being released, the same PE can be used to pause an SRB in, say, address space 23. There is, however, a small performance penalty imposed when a PE is used to pause a task or SRB in one space and then reused to pause a task or SRB in another space. This cost is accrued upon each space transition.

The following services (IEAVAPE2, IEAVDPE2, IEAVPSE2, IEAVRLS2, IEAVRPI2, IEAVXFR2, IEA4APE2, IEA4DPE2, IEA4PSE2, IEA4RLS2, IEA4RPI2, and IEA4XFR2) have a 'LINKAGE=' keyword that specifies whether the caller is authorized (LINKAGE=BRANCH requires the caller to be in key 0 supervisor state). The authorization of the PET is not specified, except when it is allocated via the IEAVAPE2 (or IEA4APE2) service. Instead, the authorization of the PET is implied. Authorized users can use any PET, but unauthorized users only can use a PET that was allocated for unauthorized use.

When an authorized program is passed a PET from an unauthorized program, the authorized program must ensure that the PET is valid to be used by the unauthorized program. The authorized program can validate this by invoking the IEAVRPI2 (or IEA4RPI2) service and specifying a special value for the linkage parameter. When an authorized program needs to validate that a PET can be used by an unauthorized program, add IEA_UNTRUSTED_PET to the value specified for LINKAGE and invoke the IEAVRPI2 service. The data returned by the IEAVRPI2 service identifies whether the unauthorized caller is able to use the PET:

A PE can be used to pause only one task or SRB at a time; the system does not allow more then one dispatchable unit to be paused under a single PE.

Pause elements are not supported by checkpoint/restart. However, support has been added with APAR OA19821 to permit the allocation of pause elements that can allow a successful checkpoint/restart. This is possible for applications that can tolerate the fact that the pause element will not be restored upon a restart after a checkpoint. An application can tell if this support is available by checking if CVTPAUS4 has been set in the CVT. A new type is introduced for the auth_level parameter of the Allocate Pause Element service. The new level is created by adding the value of the new type (IEA_CHECKPOINTOK) to the existing value (at one time, only IEA_AUTHORIZED or IEA_UNAUTHORIZED can be specified). When pause elements are allocated, a checkpoint is accepted only if all encountered pause elements have been allocated indicating the IEA_CHECKPOINTOK type.