Glossary · Term

two-phase locking

← all terms

Definition

Plain language

A database strategy where you lock each thing before touching it and hold all your locks until you're done, making everyone else wait.

As stated in the literature

2PL — a pessimistic concurrency-control protocol that acquires locks before access and releases them only at commit, guaranteeing serializability at the cost of waiting and potential deadlock; for long agent transactions, locks held for minutes stall peers.

Also called: 2PL

Why it matters: It reliably prevents conflicting operations from corrupting data, but for long-running AI tasks the lengthy waits and risk of deadlock can stall everyone else.

For example, before changing an account balance, a transaction locks that account and holds the lock until it fully finishes, forcing any other transaction touching it to wait.

Heard on the show

“The first is pessimistic — two-phase locking, usually written as 2PL.”
Episode 150 — Don't Kill the Loser: A Different Way to Handle Two AI Agents Colliding

Mentioned in 1 episode

  1. 150
    Don't Kill the Loser: A Different Way to Handle Two AI Agents Colliding

Related terms