Hash table latching

Easy to support concurrent access due to the limited ways threads access the data structure.

-> All threads move in the same direction and only access a single page/slot at a time

-> Deadlocks are not possible

To resize the table, take a global latch on the entire table (i.e.., in the header page).

---

#1: Page latches

  • Each page has its own reader-write latch that protects its entire contents

  • Threads acquire either a read or write latch before they access a page.

#2: Slot latches

  • Each slot has its own latch

  • Can use a single mode latch to reduce meta-data and computational overhead.

Last updated