From Lock-Free to Wait-Free: Linked List Edward Duong Outline 1) - - PowerPoint PPT Presentation

from lock free to wait free linked list
SMART_READER_LITE
LIVE PREVIEW

From Lock-Free to Wait-Free: Linked List Edward Duong Outline 1) - - PowerPoint PPT Presentation

From Lock-Free to Wait-Free: Linked List Edward Duong Outline 1) Outline operations of the locality conscious linked list [Braginsky 2012] 2) Transformation concept from lock-free -> wait-free [Timnat 2014] Why Build Concurrent ADTs


slide-1
SLIDE 1

From Lock-Free to Wait-Free: Linked List

Edward Duong

slide-2
SLIDE 2

Outline

1) Outline operations of the locality conscious linked list [Braginsky 2012] 2) Transformation concept from lock-free -> wait-free [Timnat 2014]

slide-3
SLIDE 3

Why Build Concurrent ADTs

  • Leverage multi-cores for speed and throughput

i.e., how many operations can we perform at once

  • Achieving performance guarantees for applications such as

real-time systems

slide-4
SLIDE 4

Brief History

Wait-Free (WF) and Lock-Free (LF) ADTs:

1993 - Queue (WF) - Herlihy 1995 - Linked List (LF) - Valois 2002 - Hash Tables (LF) - Michael 2005 - B-Tree (LF) - Bender 2010 - Locality-conscious Linked List (LF) - Braginsky and Petrank 2012 - B+Tree (LF) - Braginsky and Petrank

slide-5
SLIDE 5

Freedom!

Blocking

  • Operations use heavy mutual exclusion

Increase in guarantees

Terminology from M. Herlihy [1988, 1990]

slide-6
SLIDE 6

Freedom!

Blocking

  • Operations are serialized

Obstruction-free

  • Guaranteed to complete an operation if there is no contention

Increase in guarantees

Terminology from M. Herlihy [1988, 1990]

slide-7
SLIDE 7

Freedom!

Blocking

  • Operations are serialized

Obstruction-free

  • Guaranteed to complete an operation if there is no contention

Lock-free

  • Even with contention, at least one operation will succeed

Increase in guarantees

Terminology from M. Herlihy [1988, 1990]

slide-8
SLIDE 8

Freedom!

Blocking

  • Operations are serialized

Obstruction-free

  • Guaranteed to complete an operation if there is no contention

Lock-free

  • Even with contention, at least one operation will succeed

Increase in guarantees

Wait-free

  • Even with contention, all operations are bounded

Terminology from M. Herlihy [1988, 1990]

slide-9
SLIDE 9

Freedom!

Blocking

  • Operations are serialized

Obstruction-free

  • Guaranteed to complete an operation if there is no contention

Lock-free

  • Even with contention, at least one operation will succeed

Wait-free

  • Even with contention, all operations are bounded

=

Increase in throughput

Terminology from M. Herlihy [1988, 1990]

slide-10
SLIDE 10

Linked List: Details

  • Ordered list
  • Stores key / data pairs; no duplicate keys
  • Operations: Search, Insert and Delete
  • Locality Conscious (optimized for cache)
slide-11
SLIDE 11

Chunks

Virtual page ...

slide-12
SLIDE 12

Chunks

slide-13
SLIDE 13

Search(key)

  • Search for key: 20
slide-14
SLIDE 14

Search(key)

  • Search for key: 20
slide-15
SLIDE 15

Search(key)

  • Search for key: 20
slide-16
SLIDE 16

Search(key)

  • Search for key: 20
slide-17
SLIDE 17

Insert(key, data)

  • Insert key 18 with data

3

slide-18
SLIDE 18

Insert(key, data)

  • Insert key 18 with data

3

slide-19
SLIDE 19

Insert(key, data)

  • Insert key 18 with data

3

slide-20
SLIDE 20

Insert(key, data)

  • Insert key 18 with data

3

slide-21
SLIDE 21

Insert(key, data)

  • Insert key 18 with data

3

slide-22
SLIDE 22

Insert(key, data)

  • Insert key 18 with data

3

slide-23
SLIDE 23

Insert(key, data)

  • Insert key 18 with data

3

slide-24
SLIDE 24

Delete(key)

  • Delete key 60
slide-25
SLIDE 25

Delete(key)

  • Delete key 60
slide-26
SLIDE 26

Delete(key)

  • Delete key 60
slide-27
SLIDE 27

Delete(key)

  • Delete key 60
slide-28
SLIDE 28

Delete(key)

  • Delete key 60
slide-29
SLIDE 29

Delete(key)

  • Delete key 60
slide-30
SLIDE 30

Lock-Free -> Wait-Free

  • Can we go from: At least one operation finishing after some

finite steps -> any operation is bounded by some finite number of steps? Recipe:

  • Contention Counter
  • Help Queue
  • Modifications to: Search, Insert and Delete
slide-31
SLIDE 31

Concept Behind Helping

Operation 1 Operation 2 Operation 3

slide-32
SLIDE 32

Concept Behind Helping

Enqueue: Operation 1 Operation 2 Operation 3

slide-33
SLIDE 33

Concept Behind Helping

Operation 1 Helping 1 Operation 3

slide-34
SLIDE 34

Concept Behind Helping

Operation 1 Helping 1 Helping 1

slide-35
SLIDE 35

Concept Behind Helping

Success Operation 4 Operation 5

slide-36
SLIDE 36

Conclusions

  • Adoption is on the rise!
  • Libraries:

○ Boost ○ Noble (Swedish research group) ○ Amino Concurrent Building Blocks

slide-37
SLIDE 37

Bibliography

  • Braginsky, Anastasia, and Erez Petrank. "Locality-conscious lock-free linked lists." Distributed Computing and Networking. Springer

Berlin Heidelberg, 2011. 107-118.

  • Timnat, Shahar, and Erez Petrank. "A Practical Wait-Free Simulation for Lock-Free Data Structures." (2014).
  • Herlihy, Maurice. "A methodology for implementing highly concurrent data objects." ACM Transactions on Programming Languages

and Systems (TOPLAS) 15.5 (1993): 745-770.

  • Valois, John D. "Lock-free linked lists using compare-and-swap." Proceedings of the fourteenth annual ACM symposium on Principles
  • f distributed computing. ACM, 1995.
  • Michael, Maged M. "High performance dynamic lock-free hash tables and list-based sets." Proceedings of the fourteenth annual ACM

symposium on Parallel algorithms and architectures. ACM, 2002.

  • Bender, Michael A., Erik D. Demaine, and Martin Farach-Colton. "Cache-oblivious B-trees." Foundations of Computer Science, 2000.
  • Proceedings. 41st Annual Symposium on. IEEE, 2000.
  • Braginsky, Anastasia, and Erez Petrank. "A lock-free b+ tree." Proceedinbgs of the 24th ACM symposium on Parallelism in algorithms

and architectures. ACM, 2012.

  • Herlihy, Maurice P. "Impossibility and universality results for wait-free synchronization." Proceedings of the seventh annual ACM

Symposium on Principles of distributed computing. ACM, 1988. Libraries: http://www.boost.org/doc/libs/1_53_0/doc/html/lockfree.html http://www.noble-library.org/ http://amino-cbbs.sourceforge.net/what-is-cbbs.html