Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Algorithm

Two-phase locking

Parallel and Distributed Algorithm

Two-phase locking, abbreviated 2PL, is a pessimistic concurrency control method used in databases and transaction processing that guarantees conflict-serializability. The name also refers to the set of transaction schedules, or histories, that the protocol produces. Transactions apply locks to the data they use, and those locks may block other transactions from reaching the same data for the life of the transaction. Locks are handled in two consecutive phases: in the expanding phase locks are acquired and none are released, and in the shrinking phase locks are released and none are acquired, so no transaction may acquire a lock after it has released one. The basic protocol uses shared and exclusive locks, that is read locks and write locks, and refinements may add other lock types. Because locks block, 2PL and its variants S2PL and SS2PL can run into deadlocks when two or more transactions wait on each other.

Connections

In Field

Databases, Fields
Source Two-phase locking (Wikipedia)
Sources
Two-phase locking (Wikipedia)
  • In Field: Databases, Lead sentence
    In databases and transaction processing, two-phase locking (2PL) is a pessimistic concurrency control method that guarantees conflict-serializability.
  • In Group: Concurrency and Distributed Systems Techniques, Lead sentence
    In databases and transaction processing, two-phase locking (2PL) is a pessimistic concurrency control method that guarantees conflict-serializability.
View the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.