Techniques are disclosed for managing resources that are accessible to
a plurality of entities. In one embodiment, shared locks on a resource are granted
more efficiently by maintaining data that is local to (e.g. on the same node as)
each entity to indicate whether an exclusive lock has been granted on the resource
to any entity of the plurality of entities. Data that (15) is maintained
local to an entity, and that (16) indicates whether any entity has an exclusive
lock on a particular resource is referred to herein as a "local exclusive lock
flag" for that particular resource. When an entity of the plurality of entities
seeks to acquire a shared lock for a particular resource, that entity checks the
local exclusive lock flag for that particular resource. If the local exclusive
lock flag indicates that no entity holds an exclusive lock on the resource, then
the entity seeking the shared lock acquires the shared lock without first receiving
a lock grant from the resource manager that manages the resource. In many cases,
the resource manager that manages the resource is remotely located relative to
the entity that desires the shared lock. Because the local exclusive lock flag
is local, the act of checking it does not incur the overhead associated with communicating
with a remotely located resource manager. Thus, obtaining a shared lock based on
the state of a local exclusive lock flag significantly increases the efficiency
of managing access to the resource, particularly for resources for which entities
do not frequently require exclusive access.