Concurrent deferred reference counting with constant-time overhead
Open Access
- 18 June 2021
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 526-541
Abstract
We present a safe automatic memory reclamation approach for concurrent programs, and show that it is both theoretically and practically efficient. Our approach combines ideas from referencing counting and hazard pointers in a novel way to implement concurrent reference counting with wait-free, constant-time overhead. It overcomes the limitations of previous approaches by significantly reducing modifications to, and hence contention on, the reference counts. Furthermore, it is safer and easier to use than manual approaches. Our technique involves using a novel generalization of hazard pointers to defer reference-count decrements until no other process can be incrementing them, and to defer or elide reference-count increments for short-lived references. We have implemented the approach as a C++ library and compared it experimentally to several methods including existing atomic reference-counting libraries and state-of-the art manual techniques. Our results indicate that our technique is faster than existing reference-counting implementations, and competitive with manual memory reclamation techniques. More importantly, it is significantly safer than manual techniques since objects are reclaimed automatically.Keywords
Funding Information
- National Science Foundation (CCF-1901381,CCF-1910030,CCF-1919223)
This publication has 37 references indexed in Scilit:
- A methodology for creating fast wait-free data structuresACM SIGPLAN Notices, 2012
- Performance of memory reclamation for lockless synchronizationJournal of Parallel and Distributed Computing, 2007
- Nonblocking memory management support for dynamic-sized data structuresACM Transactions on Computer Systems, 2005
- Hazard pointers: safe memory reclamation for lock-free objectsIEEE Transactions on Parallel and Distributed Systems, 2004
- Lock-free reference countingDistributed Computing, 2002
- The Repeat Offender Problem: A Mechanism for Supporting Dynamic-Sized, Lock-Free Data Structures2002
- A Pragmatic Implementation of Non-blocking Linked-lists2001
- Minimizing reference count updating with deferred and anchored pointers for functional data structuresACM SIGPLAN Notices, 1994
- Linearizability: a correctness condition for concurrent objectsACM Transactions on Programming Languages and Systems, 1990
- An efficient, incremental, automatic garbage collectorCommunications of the ACM, 1976