ENQ (Enqueue)

With XCF STP and other sharing facilities, there is a need to ensure that systems within a Sysplex don't get in their way. (or different tasks and processes on the same system)

An ENQ or Enqueue can be used to achieve this.

They are used by tasks to serialise a resource.

Any task can request an enqueue which will have 2 names

If a task has already requested and obtained an enqueue, if another task requests it, then it will have to wait, or do some other processing, as it cannot obtain it. once the first task is done and it releases the enqueue, the other tasks can obtain it and go about their processing.

Enqueues don't have connections to any actual resources, to the system they are simply a pair of two names, that can be held only by one task at a time.

z/OS itself also uses enqueues. For example the QName SYSDSN is used to serialise access to datasets. In this case, the RName is the name of the dataset being accessed.