两阶段锁
两阶段锁(two-phase locking,2PL)是数据库事务处理时的并发控制方法,以保证可串行化。[1][2]
这种方法使用数据库锁在两个阶段:
- 扩张阶段:不断上锁,没有锁被释放
- 收缩阶段:锁被陆续释放,没有新的加锁
2PL可能会导致死锁。
参考文献
- Philip A. Bernstein, Vassos Hadzilacos, Nathan Goodman (1987): Concurrency Control and Recovery in Database Systems (页面存档备份,存于), Addison Wesley Publishing Company, ISBN 0-201-10715-5
- Gerhard Weikum, Gottfried Vossen (2001): Transactional Information Systems (页面存档备份,存于), Elsevier, ISBN 1-55860-508-8
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.