concsearchstruct

# concsearchstruct - Designing Concurrent Search Structure...

This preview shows pages 1–9. Sign up to view the full content.

Designing Concurrent Search Structure Algorithms Dennis Shasha

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
What is a Search Structure? Data structure (typically a B tree, hash structure, R-tree, etc.) that supports a dictionary. Operations are insert key-value pair, delete key-value pair, and search for key- value pair.
How to make a search structure algorithm concurrent Naïve approach: use two phase locking (but then at the very least the root is read- locked so lock conflicts are frequent). Semi-naïve algorithm: use hierarchical tree locking: lock root; afterwards lock node n only if you hold lock on parent of n. (Still tends to hold locks high in tree.)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
How can we do better: fundamental insight In a search structure algorithm, all that we really care about is that we implement the dictionary operations correctly. Operations on structure need not even be serializable provided they maintain certain constraints.
Train Your Intuition: parable of the library Imagine a library with books. It’s a little old fashion so there are still card catalogues that identify the shelf where a book is held. Bob wants to get a book B. Alice is working on reorganizing the library by moving books from shelf to shelf and then changing the card catalogue.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Parable of the library: interleaving of ops Bob 1. look up book B in catalogue. Bob 2. read “go to shelf S” Bob 3. Start walking but see friend. Alice 1: move several books from S to S’, leaving a note. Alice 2: change catalogue so B maps to S’ Bob 4: go to S, follow note to S’
Parable of the library: observations Not conflict-preserving serializable: Bob Alice (Bob reads catalog then Alice changes it) Alice Bob (Alice modifies S before Bob reads) Indeed in no serial execution would Bob go to two shelves. Yet execution is completely ok!

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Parable of the library: what’s going on? All we care about is that
This is the end of the preview. Sign up to access the rest of the document.

## concsearchstruct - Designing Concurrent Search Structure...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online