Categories of locks

There are two categories of locks:
  • Global locks -- protect serially reusable resources related to more than one address space.
  • Local locks -- protect the resources assigned to a particular address space. When the local lock is held for an address space, the owner of the lock has the right to manipulate the queues and control blocks associated with that address space.
Note: The term CML (cross memory local) lock means the local lock of an address space other than the home address space. LOCAL lock means the local lock of the home address space. When written in lower case, local lock means any local-level lock, either the LOCAL or a CML lock.
The CPU and CMS locks are global locks. These global locks provide system-wide services or use control information in the common area and must serialize across address spaces. The local level locks, on the other hand, do not serialize across address spaces, but serialize functions executing within the address space. Table 1 summarizes the characteristics of MVS™ locks.
Table 1. Summary of Locking Characteristics
lock global local spin suspend single multiple (class)
CPU X   X     X
CMS X     X X  
CML   X   X   X
LOCAL   X   X   X
Note: The CPU lock has no real hierarchy except that once a user obtains it, the user cannot obtain a suspend lock. The CPU lock could be considered a pseudo spin lock. It could also be considered multiple because there is one per processor and any number of requestors can hold it at the same time.