{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

12~Chapter_14 - ConcurrentSkipLists Companionslidesfor...

Info icon This preview shows pages 1–21. Sign up to view the full content.

View Full Document Right Arrow Icon
Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Concurrent Skip Lists
Image of page 1

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

View Full Document Right Arrow Icon
Art of Multiprocessor Programming © Herlihy Shavit 2007 Set Object Interface Collection of elements No duplicates Methods add()  a new element remove()  an element contains()  if element is present
Image of page 2
Art of Multiprocessor Programming © Herlihy Shavit 2007 Many are Cold but Few are Frozen Typically high % of  contains()  calls Many fewer  add()  calls And even fewer  remove()  calls 90%   contains() 9%   add() 1%   remove() Folklore? Yes but probably mostly true
Image of page 3

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

View Full Document Right Arrow Icon
Art of Multiprocessor Programming © Herlihy Shavit 2007 Concurrent Sets Balanced Trees? Red - Black  trees, AVL trees, … Problem : no one does this well … … because  rebalancing  after  add()  or  remove()  is  a global operation
Image of page 4
Art of Multiprocessor Programming © Herlihy Shavit 2007 Skip Lists 2 5 8 7 9 0 Probabilistic Data Structure No global rebalancing Logarithmic-time search
Image of page 5

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

View Full Document Right Arrow Icon
Art of Multiprocessor Programming © Herlihy Shavit 2007 Skip List Property 9 0 Each layer is  sublist  of lower-levels
Image of page 6
Art of Multiprocessor Programming © Herlihy Shavit 2007 Skip List Property 7 9 0 Each layer is  sublist  of lower-levels
Image of page 7

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

View Full Document Right Arrow Icon
Art of Multiprocessor Programming © Herlihy Shavit 2007 Skip List Property 5 7 9 0 Each layer is  sublist  of lower-levels
Image of page 8
Art of Multiprocessor Programming © Herlihy Shavit 2007 Skip List Property 5 8 7 9 0 Each layer is  sublist  of lower-levels
Image of page 9

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

View Full Document Right Arrow Icon
Art of Multiprocessor Programming © Herlihy Shavit 2007 Skip List Property 2 5 8 7 9 0 Each layer is  sublist  of lower-levels Lowest level is entire list
Image of page 10
Art of Multiprocessor Programming © Herlihy Shavit 2007 Skip List Property 2 5 8 7 9 0 Each layer is  sublist  of lower-levels Not easy to preserve in concurrent implementations 
Image of page 11

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

View Full Document Right Arrow Icon
Art of Multiprocessor Programming © Herlihy Shavit 2007 Search 2 5 8 7 9 0 contains(8) Too far
Image of page 12
Art of Multiprocessor Programming © Herlihy Shavit 2007 Search 2 5 8 7 9 0 contains(8) OK
Image of page 13

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

View Full Document Right Arrow Icon
Art of Multiprocessor Programming © Herlihy Shavit 2007 Search 2 5 8 7 9 0 contains(8) Too far
Image of page 14
Art of Multiprocessor Programming © Herlihy Shavit 2007 Search 2 5 8 7 9 0 contains(8) Too far
Image of page 15

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

View Full Document Right Arrow Icon
Art of Multiprocessor Programming © Herlihy Shavit 2007 Search 2 5 8 7 9 0 contains(8) Yes!
Image of page 16
Art of Multiprocessor Programming © Herlihy Shavit 2007 7 Search 8 0 2 5 9 contains(8)
Image of page 17

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

View Full Document Right Arrow Icon
Art of Multiprocessor Programming © Herlihy Shavit 2007 7 Logarithmic 8 0 2 5 9 contains(8) Log N
Image of page 18
Art of Multiprocessor Programming © Herlihy Shavit 2007 Why Logarthimic 2 5 8 7 9 0 Property : Each pointer at layer  jumps over roughly  2 i   nodes Pick node heights  randomly  so property guaranteed  probabilistically 2 i 2 i
Image of page 19

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

View Full Document Right Arrow Icon
Art of Multiprocessor Programming © Herlihy Shavit 2007 Find() -- Sequential    int  find(T x, Node<T>[] preds, Node<T>[]  succs) {    …    }
Image of page 20
Image of page 21
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern