How It Works: SQL Server Lock Partitioning

Moved from:

Previous posts have discussed partitioning, for example, a partitioned memory object and how a latch maintains the desired access (exclusive, shared, …)


Quick Refresher Over Partitioned Protection/Locking

Acquiring shared access requires only the local partition be acquired (lightweight scalability) Acquiring exclusive access requires all partitions be acquired (heavier and can be slower)

Shared access blocks exclusive acquire requests. The shared access needs only to acquire on the worker’s local partition. An attempt to acquire exclusive access is blocked by the shared access holders. Conversely to acquire exclusive access the worker must acquire the exclusive access of every