Enhancing Lock-Based Concurrency Control: Strategies for Multiple Writes
This guide outlines an improved lock-based concurrency control model that accommodates multiple write operations efficiently. It introduces key concepts such as shared and exclusive locks, update locks, and hierarchical locking with multiple granularities. You will learn how to effectively manage lock upgrades, how to prevent deadlocks, and the importance of intention locks. Step-by-step instructions are provided, emphasizing the correct acquisition of locks to maintain data integrity in concurrent environments. Perfect for developers seeking to optimize database performance.
Enhancing Lock-Based Concurrency Control: Strategies for Multiple Writes
E N D
Presentation Transcript
Transactions Concurrency Control
Improved lock-based concurrency with multiple writes Update Locks
An Example 11 steps
Upgrading Locks • Use Shared Locks when reading • Upgrade (if possible) to Exclusive Lock when just before writing • Block if upgrade is denied.
Upgrading Locks 9 steps!
Deadlocks A new lock called the Update Lock (UL). Similar to a Shared Lock except only UL can be upgraded. Not symmetrical!
Improved lock-based concurrency with hierarchical data Hierarchical locking
Multiple Granularities • Relations • Blocks • Tuples
Intention Locks • Represented as IS for intention to share a descendant, and IX for intention to write a descendant. • Acquire an intention lock on the parentbefore acquiring any lock on a child.
Rules • Intention-lock the parents before using SL or XL on an element. • If at the element to lock, request a lock.