concsearchstruct

concsearchstruct - Designing Concurrent Search Structure...

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

View Full Document Right Arrow Icon
Designing Concurrent Search Structure Algorithms Dennis Shasha
Background image of page 1

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

View Full DocumentRight Arrow Icon
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.
Background image of page 2
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.)
Background image of page 3

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

View Full DocumentRight Arrow Icon
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.
Background image of page 4
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.
Background image of page 5

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

View Full DocumentRight Arrow Icon
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’
Background image of page 6
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!
Background image of page 7

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

View Full DocumentRight Arrow Icon
Parable of the library: what’s going on? All we care about is that
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 30

concsearchstruct - Designing Concurrent Search Structure...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online