Macro | Brief description |
CHKSI | Checks the queue occupancy of a serialization item |
DEQAR | Terminates the (exclusive) use of a serialization item by the task associated with the |
DISSI | Cancels the assignment of the task to the serialization item. |
ENASI | Assigns the task to a serialization item. The serialization item is established if it is not |
ENQAR | Requests the (exclusive) use of a serialization item. |
Introduction
The user is supplied with a semaphore-type mechanism which permits serial access to certain items (serialization items).
Serialization item
A serialization item is not linked with any particular characteristic. It is the responsibility of the user to confer a particular characteristic and identity on the serialization item.
A serialization item is identified by a name; an ID is also provided and can be used in further macros of the same task in order to speed up processing.
Scope of a serialization item (SCOPE operand)
The SCOPE operand specifies the scope (participating group) for a serialization item. The scope may encompass a single task, all the tasks under one ID, or all the tasks in the system.
Enabling the use of a serialization item
A serialization item must be assigned to a task before an (exclusive) access request for the item (ENQAR) can be processed.
A serialization item is assigned to a task either explicitly by means of ENASI (ENAble Serialization Item) or implicitly using ENQAR (ENQueue Access Request) with a name. If there is already a serialization item with the stated name in the defined scope (established by an ENASI macro in another task), the macro merely causes the serialization item to be assigned to the task associated with the calling program. Otherwise the serialization item is established and assigned by the system. An ID is provided for the serialization item only if an explicit enable function (ENASI) is used.
A task can use up to 2000 serialization items simultaneously.
Canceling the assignment of a serialization item
A serialization item assignment is canceled either explicitly by means of a DISSI macro (DISable Serialization Item) or implicitly by means of a DEQAR macro (DEQueue Access Request) with the DISSI operand. If the serialization item is not used by any other task, it is deleted.
An ENASI macro for a serialization item that has already been disabled does not necessarily produce the same ID assignment as that established by the preceding ENASI call.
Program termination
With program termination, the assignment of the task to all the serialization items used is canceled.
Access request for a serialization item (ENQAR macro)
The ENQAR macro (ENQueue Access Request) requests (exclusive) access to the specified serialization item. The request is entered in the serialization item queue and the task is placed in a wait state until it is first in the queue, when it resumes execution and uses the serialization item until a DEQAR call (DEQueue Access Request) is issued for this item.
If no serialization item with the specified name exists in the defined scope, one is established and assigned (implicit enable function).
Using the COND operand, the user can specify whether the access request is to be satisfied immediately or whether it may wait. The waiting time is specified by the LIFETIM operand.
Terminating access to a serialization item (DEQAR macro)
The DEQAR macro (DEQueue Access Request) terminates a task's access to the specified serialization item.
Access can be terminated by the task which requested the access or by any other task which also uses this serialization item (operand HOLDER=ANY in the DEQAR call).
Optionally (DISSI operand), the assignment between the task and the serialization item can also be canceled (implicit disable function).
Checking a serialization item (CHKSI macro)
The CHKSI macro (CHecK Serialization Item) provides information about availability and access (for the task associated with the calling program or any other task) of the specified serialization item. This information is made available as a return code (in register R15).