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 ● 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
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
Freedom! Increase in guarantees Blocking - Operations use heavy mutual exclusion Terminology from M. Herlihy [1988, 1990]
Freedom! Obstruction-free Increase in guarantees - Guaranteed to complete an operation if there is no contention Blocking - Operations are serialized Terminology from M. Herlihy [1988, 1990]
Freedom! Lock-free - Even with contention, at least one operation will succeed Obstruction-free Increase in guarantees - Guaranteed to complete an operation if there is no contention Blocking - Operations are serialized Terminology from M. Herlihy [1988, 1990]
Freedom! Wait-free - Even with contention, all operations are bounded Lock-free - Even with contention, at least one operation will succeed Obstruction-free Increase in guarantees - Guaranteed to complete an operation if there is no contention Blocking - Operations are serialized Terminology from M. Herlihy [1988, 1990]
Freedom! Wait-free - Even with contention, all operations are bounded = Lock-free - Even with contention, at least one operation will succeed Obstruction-free Increase in - Guaranteed to complete an operation if there is no contention throughput Blocking - Operations are serialized Terminology from M. Herlihy [1988, 1990]
Linked List: Details ● Ordered list ● Stores key / data pairs; no duplicate keys ● Operations: Search, Insert and Delete ● Locality Conscious (optimized for cache)
Chunks ... Virtual page
Chunks
Search(key) ● Search for key: 20
Search(key) ● Search for key: 20
Search(key) ● Search for key: 20
Search(key) ● Search for key: 20
Insert(key, data) ● Insert key 18 with data 3
Insert(key, data) ● Insert key 18 with data 3
Insert(key, data) ● Insert key 18 with data 3
Insert(key, data) ● Insert key 18 with data 3
Insert(key, data) ● Insert key 18 with data 3
Insert(key, data) ● Insert key 18 with data 3
Insert(key, data) ● Insert key 18 with data 3
Delete(key) ● Delete key 60
Delete(key) ● Delete key 60
Delete(key) ● Delete key 60
Delete(key) ● Delete key 60
Delete(key) ● Delete key 60
Delete(key) ● Delete key 60
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
Concept Behind Helping Operation 1 Operation 2 Operation 3
Concept Behind Helping Enqueue: Operation 2 Operation 3 Operation 1
Concept Behind Helping Operation 1 Helping 1 Operation 3
Concept Behind Helping Operation 1 Helping 1 Helping 1
Concept Behind Helping Success Operation 4 Operation 5
Conclusions ● Adoption is on the rise! ● Libraries: ○ Boost ○ Noble (Swedish research group) ○ Amino Concurrent Building Blocks
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 of 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
Recommend
More recommend