Memory reuse in link-based lock-free data structures requires special care. Many lock-free algorithms require deleted nodes not to be reused until no active pointers point to them. Also, most lock-free algorithms use the compare_and_swap atomic primitive, which can suffer from the ``ABA problem'''' associated with memory reuse. Valois ~\cite{Valois-thesis-1995} proposed a memory management method for link-based data structures that addresses these problems. The method associates a reference count with each node of reusable memory. A node is reused only when no processes or data structures point to it. The method solves the ABA problem for acyclic link-based data structures, and allows lock-free algorithms more flexibility as nodes are not required to be freed immediately after a delete operation (e.g.\ dequeue, pop, delete min, etc.). However, there are race conditions that may corrupt data structure that use this method. In this report we correct these race conditions and present a corrected version of Valois''s method.
Cited By
- Nikolaev R and Ravindran B (2024). A Family of Fast and Memory Efficient Lock- and Wait-Free Reclamation, Proceedings of the ACM on Programming Languages, 8:PLDI, (2174-2198), Online publication date: 20-Jun-2024.
- Parkinson M, Clebsch S and Simner B Wait-Free Weak Reference Counting Proceedings of the 2023 ACM SIGPLAN International Symposium on Memory Management, (85-96)
- Asgharzadeh A, Cebrian J, Perais A, Kaxiras S and Ros A Free atomics Proceedings of the 49th Annual International Symposium on Computer Architecture, (14-26)
- Nikolaev R and Ravindran B Snapshot-free, transparent, and robust memory reclamation for lock-free data structures Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation, (987-1002)
- Wang Z, Xue J and Shao Z (2021). Heracles, Proceedings of the VLDB Endowment, 14:6, (1080-1092), Online publication date: 1-Feb-2021.
- Nikolaev R and Ravindran B Universal wait-free memory reclamation Proceedings of the 25th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, (130-143)
- Meyer R and Wolff S (2019). Decoupling lock-free data structures from memory reclamation for static analysis, Proceedings of the ACM on Programming Languages, 3:POPL, (1-31), Online publication date: 2-Jan-2019.
- Kerbl B, Kenzel M, Mueller J, Schmalstieg D and Steinberger M The Broker Queue Proceedings of the 2018 International Conference on Supercomputing, (76-85)
- Wen H, Izraelevitz J, Cai W, Beadle H and Scott M (2018). Interval-based memory reclamation, ACM SIGPLAN Notices, 53:1, (1-13), Online publication date: 23-Mar-2018.
- Wen H, Izraelevitz J, Cai W, Beadle H and Scott M Interval-based memory reclamation Proceedings of the 23rd ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, (1-13)
- Sethi D, Talupur M and Malik S (2016). Model checking unbounded concurrent lists, International Journal on Software Tools for Technology Transfer (STTT), 18:4, (375-391), Online publication date: 1-Aug-2016.
- Cohen N and Petrank E (2015). Automatic memory reclamation for lock-free data structures, ACM SIGPLAN Notices, 50:10, (260-279), Online publication date: 18-Dec-2015.
- Cohen N and Petrank E Automatic memory reclamation for lock-free data structures Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, (260-279)
- Harris T and Fraser K (2014). Language support for lightweight transactions, ACM SIGPLAN Notices, 49:4S, (64-78), Online publication date: 1-Jul-2014.
- Gupta S and Wilsey P Lock-free pending event set management in time warp Proceedings of the 2nd ACM SIGSIM Conference on Principles of Advanced Discrete Simulation, (15-26)
- McKenney P (2013). Structured deferral, Communications of the ACM, 56:7, (40-49), Online publication date: 1-Jul-2013.
- McKenney P (2013). Structured Deferral: Synchronization via Procrastination, Queue, 11:5, (20-39), Online publication date: 1-May-2013.
- Abdulla P, Haziza F, Holík L, Jonsson B and Rezine A An integrated specification and verification technique for highly concurrent data structures Proceedings of the 19th international conference on Tools and Algorithms for the Construction and Analysis of Systems, (324-338)
- Liu F, Nedev N, Prisadnikov N, Vechev M and Yahav E (2012). Dynamic synthesis for relaxed memory models, ACM SIGPLAN Notices, 47:6, (429-440), Online publication date: 6-Aug-2012.
- Sethi D, Talupur M, Schwartz-Narbonne D and Malik S Parameterized model checking of fine grained concurrency Proceedings of the 19th international conference on Model Checking Software, (208-226)
- Kuperstein M, Vechev M and Yahav E (2012). Automatic inference of memory fences, ACM SIGACT News, 43:2, (108-123), Online publication date: 11-Jun-2012.
- Liu F, Nedev N, Prisadnikov N, Vechev M and Yahav E Dynamic synthesis for relaxed memory models Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation, (429-440)
- Kuperstein M, Vechev M and Yahav E Automatic inference of memory fences Proceedings of the 2010 Conference on Formal Methods in Computer-Aided Design, (111-120)
- Gidenstam A, Papatriantafilou M and Tsigas P (2010). NBmalloc, Algorithmica, 58:2, (304-338), Online publication date: 1-Oct-2010.
- Černý P, Radhakrishna A, Zufferey D, Chaudhuri S and Alur R Model checking of linearizability of concurrent list implementations Proceedings of the 22nd international conference on Computer Aided Verification, (465-479)
- Burckhardt S, Dern C, Musuvathi M and Tan R (2010). Line-up, ACM SIGPLAN Notices, 45:6, (330-340), Online publication date: 12-Jun-2010.
- Burckhardt S, Dern C, Musuvathi M and Tan R Line-up Proceedings of the 31st ACM SIGPLAN Conference on Programming Language Design and Implementation, (330-340)
- Gidenstam A and Papatriantafilou M (2009). LFTHREADS, ACM SIGARCH Computer Architecture News, 36:5, (88-92), Online publication date: 20-Dec-2008.
- Jonsson B (2009). State-space exploration for concurrent algorithms under weak memory orderings, ACM SIGARCH Computer Architecture News, 36:5, (65-71), Online publication date: 20-Dec-2008.
- Gidenstam A and Papatriantafilou M LFTHREADS Proceedings of the 11th international conference on Principles of distributed systems, (217-231)
- Hart T, McKenney P, Brown A and Walpole J (2007). Performance of memory reclamation for lockless synchronization, Journal of Parallel and Distributed Computing, 67:12, (1270-1285), Online publication date: 1-Dec-2007.
- Burckhardt S, Alur R and Martin M CheckFence Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation, (12-21)
- Burckhardt S, Alur R and Martin M (2007). CheckFence, ACM SIGPLAN Notices, 42:6, (12-21), Online publication date: 10-Jun-2007.
- Fraser K and Harris T (2007). Concurrent programming without locks, ACM Transactions on Computer Systems, 25:2, (5-es), Online publication date: 1-May-2007.
- Dechev D, Pirkelbauer P and Stroustrup B Lock-free dynamically resizable arrays Proceedings of the 10th international conference on Principles of Distributed Systems, (142-156)
- Hart T, McKenney P and Brown A Making lockless synchronization fast Proceedings of the 20th international conference on Parallel and distributed processing, (21-21)
- Sundell H and Tsigas P (2005). Fast and lock-free concurrent priority queues for multi-thread systems, Journal of Parallel and Distributed Computing, 65:5, (609-627), Online publication date: 1-May-2005.
- Sundell H Wait-Free Reference Counting and Memory Management Proceedings of the 19th IEEE International Parallel and Distributed Processing Symposium (IPDPS'05) - Papers - Volume 01
- Sundell H and Tsigas P Lock-free and practical doubly linked list-based deques using single-word compare-and-swap Proceedings of the 8th international conference on Principles of Distributed Systems, (240-255)
- Fomitchev M and Ruppert E Lock-free linked lists and skip lists Proceedings of the twenty-third annual ACM symposium on Principles of distributed computing, (50-59)
- Sundell H and Tsigas P Scalable and lock-free concurrent dictionaries Proceedings of the 2004 ACM symposium on Applied computing, (1438-1445)
- Harris T and Fraser K (2003). Language support for lightweight transactions, ACM SIGPLAN Notices, 38:11, (388-402), Online publication date: 26-Nov-2003.
- Harris T and Fraser K Language support for lightweight transactions Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications, (388-402)
- Agesen O, Detlefs D, Flood C, Garthwaite A, Martin P, Shavit N and Steele G DCAS-based concurrent deques Proceedings of the twelfth annual ACM symposium on Parallel algorithms and architectures, (137-146)
- Michael M and Scott M (1998). Nonblocking Algorithms and Preemption-Safe Locking on Multiprogrammed Shared Memory Multiprocessors, Journal of Parallel and Distributed Computing, 51:1, (1-26), Online publication date: 25-May-1998.
- Michael M and Scott M Simple, fast, and practical non-blocking and blocking concurrent queue algorithms Proceedings of the fifteenth annual ACM symposium on Principles of distributed computing, (267-275)
Recommendations
Lock-Free Transactional Transformation for Linked Data Structures
Special Issue on SPAA 2016Nonblocking data structures allow scalable and thread-safe access to shared data. They provide individual operations that appear to execute atomically. However, it is often desirable to execute multiple operations atomically in a transactional manner. ...
A practical wait-free simulation for lock-free data structures
PPoPP '14: Proceedings of the 19th ACM SIGPLAN symposium on Principles and practice of parallel programmingLock-free data structures guarantee overall system progress, whereas wait-free data structures guarantee the progress of each and every thread, providing the desirable non-starvation guarantee for concurrent data structures. While practical lock-free ...
Transactional lock-free execution of lock-based programs
Special Issue: Proceedings of the 10th annual conference on Architectural Support for Programming Languages and Operating SystemsThis paper is motivated by the difficulty in writing correct high-performance programs. Writing shared-memory multi-threaded programs imposes a complex trade-off between programming ease and performance, largely due to subtleties in coordinating access ...