Locks are used in distributed software to control access to shared resources. In some cases, a distributed lock manager (DLM) provides distributed applications with a mechanism for synchronizing their accesses to shared resources. For example, DLMs are used in some clustered file systems for file locking and for coordination of other disk accesses. The resources that are accessed under locks granted by a DLM may be files, records, areas of shared memory, peripherals, databases or portions of a database, and/or other items that are shared (or potentially shared) by different software processes.
A lock may provide different kinds of access to a given resource, depending on the accesses already granted and the operations desired, for example. Different kinds of access are sometimes indicated as lock modes. For example, a lock request specifying a concurrent read mode could be used to indicate a desire to read a resource identified in the request without updating (writing) the resource. As another example, an exclusive mode indicates a desired for exclusive access which allows both reads and updates to the locked resource and prevents other software processes from having any access to the resource until the exclusive lock is released. Other lock modes may also be available in a given implementation of a DLM.