> For the complete documentation index, see [llms.txt](https://til.notdu.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://til.notdu.com/database/intro-to-database-systems/multi-threaded-index-concurrency-control/latch-crabbing-coupling.md).

# Latch crabbing/coupling

Protocol to allow multiple threads to access/modify B+ Tree at the same time.

Basic Idea:

* Get latch for parent&#x20;
* Get latch for child&#x20;
* Release latch for parent if "safe"

A safe node is one that will not split or merge when updated.

* Not full (on insertion)
* More than half-full (on deletion)
