{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


concsearchstruct - What is a Search Structure Dennis Shasha...

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

View Full Document Right Arrow Icon
*)))Designing )(((Concurrent 8Search 8Structure '&&&Algorithms *)))Dennis 8Shasha What is a 8Search 8Structure%$$$ ● *)))Data structure ±typically a ('''B tree° hash structure° 7R²tree° etc³´ that supports a dictionary³ ● 4Operations are insert key²value pair° delete key²value pair° and search for key² value pair³ ---How to make a search structure algorithm concurrent ● 3Naïve approach# use two phase locking ±but then at the very least the root is read² locked so lock conflicts are frequent´³ ● 8Semi²naïve algorithm# use hierarchical tree locking# lock root$! afterwards lock node n only if you hold lock on parent of n³ ±8Still tends to hold locks high in tree³´ ---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³ ● 4Operations on structure need not even be serializable provided they maintain certain constraints³ 9Train 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³ 5Parable of the library# interleaving of ops ● ('''Bob µ³ look up book ('''B in catalogue³ ● ('''Bob ¶³ read “go to shelf 8S” ● ('''Bob ·³ 8Start walking but see friend³ ● '&&&Alice µ# move several books from 8S to 8S’° leaving a note³ ● '&&&Alice ¶# change catalogue so ('''B maps to 8S’ ● ('''Bob ¸# go to 8S° follow note to 8S’
Background image of page 1

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

View Full Document Right Arrow Icon
5Parable of the library# observations ● 3Not conflict²preserving serializable# ('''Bob ¹ '&&&Alice ±('''Bob reads catalog then '&&&Alice changes it´ '&&&Alice ¹ ('''Bob ±'&&&Alice modifies 8S before ('''Bob reads´ ● ...Indeed in no serial execution would ('''Bob go to two shelves³ ● Yet execution is completely okº 5Parable of the library# what’s going on%$$$ ● '&&&All we care about is that µ³ structure is ok after '&&&Alice finishes³
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 5

concsearchstruct - What is a Search Structure Dennis Shasha...

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

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