What is the difference between a lock and a latch in the context of concurrent access to a database?

前端 未结 8 1646
别跟我提以往
别跟我提以往 2021-01-30 06:46

I am trying to understand a paper on concurrent B-tree, in which the author mentioned latch vs lock, and how latches do not need a \"Lock Manager\". I have been trying to figure

8条回答
  •  既然无缘
    2021-01-30 07:20

    From CMU 15-721 (Spring 2016), lecture 6 presentation, slides 25 and 26, which cites A Survey of B-Tree Locking Techniques by Goetz Graefe:

    Locks
    → Protects the index’s logical contents from other txns.
    → Held for txn duration.
    → Need to be able to rollback changes.

    Latches
    → Protects the critical sections of the index’s internal data structure from other threads.
    → Held for operation duration.
    → Do not need to be able to rollback changes.

提交回复
热议问题