Synchronizing unit of work (tasks or SRBs)

Pause, Release, and Transfer are callable services that enable you to synchronize task or SRB processing with minimal overhead. If you have, for example, an application that requires two tasks to trade control back and forth, these services provide efficient transfers of control.

These services, which are available to both unauthorized and authorized callers in Assembler as well as C or C++, use a system-managed object called a pause element to synchronize processing of tasks or SRBs. The services provide the following functions:
Start of change
Table 1. Pause, Release, and Transfer callable services
Callable service 64-bit version callable service Description
IEAVAPE, IEAVAPE2 IEA4APE, IEA4APE2 Obtains a pause element token (PET), which uniquely identifies a pause element (PE).
IEAVDPE, IEAVDPE2 IEA4DPE, IEA4DPE2 Frees a pause element (PE) that is no longer needed.
IEAVPSE, IEAVPSE2 IEA4PSE, IEA4PSE2 Pauses the current task or SRB.
IEAVRLS, IEAVRLS2 IEA4RLS, IEA4RLS2 Releases a paused task or SRB.
IEAVRPI, IEAVRPI2 IEA4RPI, IEA4RPI2 Retrieves information about a pause element (PE).
IEAVTPE IEA4TPE Tests a pause element (PE) and determines its state.
IEAVXFR, IEAVXFR2 IEA4XFR, IEA4XFR2 Releases a paused task and, when possible, gives it immediate control, while optionally pausing the task under which the Transfer request is made.
End of change

The services use a system-managed pause element (PE) rather than an application-managed control block, such as an event control block (ECB), thus reducing the possibility of error that might come from improper reuse of the control block.

As a PE is much like an ECB, the Pause service is much like the WAIT macro, and the Release service is much like the POST macro. Just as you can use POST to keep a task from waiting by "preposting", you can use Release to keep a task or SRB from pausing by "prereleasing".

The Transfer service can both release a paused task or SRB and pass control directly to the released task or SRB. The Transfer service can also pause the task or SRB that calls the service. Thus, Transfer enables quick dispatches, saving the overhead of work search. It also allows two dispatchable units to trade control back and forth with minimal overhead.

To understand how to use the services, you need to know more about pause elements (PEs) and the pause element tokens (PETs) that identify them.