PCM locks are classified based on the following two criteria: lock granularity and a combination of lock acquisition and retention. Lock granularity refers to the number of data blocks protected by one PCM lock. Lock acquisition and retention refers to the method by which an instance acquires the locks. Locks may be acquired only once, at the time of instance startup, or they may be acquired and released as needed.
One PCM lock can protect one or more data blocks. The number of blocks covered by a PCM lock is referred to as the lock’s granularity . The greater the number of blocks covered by one lock, the coarser the granularity. The lesser the number of blocks covered by one lock, the finer the granularity. Based on granularity, PCM locking approaches may be classified as either hashed locking or fine-grained locking. With hashed locking, one PCM lock protects more than one block, whereas with fine-grained locking, one PCM lock protects only one block.
Coarse granularity in locking increases the likelihood of lock contention because each lock protects many blocks. For a large transaction that’s accessing many blocks, the lock overhead may be less with coarse granularity locking because fewer locks may need to be acquired or converted. With coarse granularity locking, a hash function is used to associate locks to blocks. Therefore, this type of locking is referred to as hashed locking .
As you will see later in this chapter, PCM locks ...