Examples of lock types

The CPU lock can be considered a pseudo spin lock. The LOCAL, CML, and CMS locks are suspend locks. Their owners receive control enabled and can be interrupted to run higher priority work. If there is another request for the lock while it is held, the requestor is suspended and other work is dispatched.

NOT Programming Interface information

NOT Programming Interface information The local lockword contains the ID of the processor on which its owner is dispatched or an indication that the owner is suspended or interrupted. The CMS lockword contains the ASCB address of the locally locked address space that owns the lock. Special IDs are placed in the local lockword whenever the owner of the local lock is not currently executing on a processor because of an interruption or suspension. End of NOT Programming Interface information

End of NOT Programming Interface information

The CMS lock is an enabled global lock because some functions require significant amounts of time under the lock and could impact the responsiveness of the system. By running these functions enabled under the lock, responsiveness is retained at the expense of some increased contention for the lock.

The CPU lock is a disabled spin lock because the functions that run under the lock are of short duration and cannot tolerate interruptions. The cost in system overhead to perform the status saving necessary to accept interruptions and allow switching would offset the gain in responsiveness.

If a lock is unconditionally requested, the lock is unconditionally obtained. If the lock is conditionally requested, the requestor is given the lock if it is available; if the lock is unavailable, control is returned to the caller without the lock. (See the COND and UNCOND parameters on the SETLOCK macro in z/OS MVS Programming: Authorized Assembler Services Reference SET-WTO.)