Locking hierarchy

The locks are arranged in a hierarchy to prevent a deadlock between functions on the processor(s).

A function on a processor can request unconditionally only those locks that are higher in the hierarchy than the locks it currently holds, thus preventing deadlocks. The hierarchy is shown in Table 1, with the first lock listed being the highest lock. The CPU lock is higher in hierarchical order than any of the suspend locks. Therefore once you obtain the CPU lock, you cannot obtain any suspend lock. The CML and LOCAL locks are equal to each other in the hierarchy.

The locks provided by the system in hierarchical order are:
  • CPU (processor lock) -- serializes on the processor level, providing system-recognized (valid) disablement.
  • CMS (general cross memory services lock) -- serializes on more than one address space where this serialization is not provided by one or more of the other global locks.
  • CML (cross memory local lock) -- serializes resources in an address space other than the home address space.
  • Local storage lock (LOCAL) -- serializes functions and storage used by the local supervisor within an address space. There is one lock for each address space.

You must hold a local lock, either CML or LOCAL, when requesting the CMS lock. You cannot release the local lock while holding the cross memory services lock.