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

前端 未结 8 1661
别跟我提以往
别跟我提以往 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条回答
  •  旧时难觅i
    2021-01-30 07:34

    It really depends on your DBMS, but here's a good explanation for Oracle.

    http://www.dba-oracle.com/t_lru_latches.htm

    Latches are like locks for RAM memory structures to prevent concurrent access and ensure serial execution of kernel code. The LRU (least recently used) latches are used when seeking, adding, or removing a buffer from the buffer cache, an action that can only be done by one process at a time.

提交回复
热议问题