Turning Manual Concurrent Memory Reclamation into Automatic Reference Counting

04/12/2022
by   Daniel Anderson, et al.
0

Safe memory reclamation (SMR) schemes are an essential tool for lock-free data structures and concurrent programming. However, manual SMR schemes are notoriously difficult to apply correctly, and automatic schemes, such as reference counting, have been argued for over a decade to be too slow for practical purposes. A recent wave of work has disproved this long-held notion and shown that reference counting can be as scalable as hazard pointers, one of the most common manual techniques. Despite these tremendous improvements, there remains a gap of up to 2x or more in performance between these schemes and faster manual techniques such as epoch-based reclamation (EBR). In this work, we first advance these ideas and show that in many cases, automatic reference counting can in fact be as fast as the fastest manual SMR techniques. We generalize our previous Concurrent Deferred Reference Counting (CDRC) algorithm to obtain a method for converting any standard manual SMR technique into an automatic reference counting technique with a similar performance profile. Our second contribution is extending this framework to support weak pointers, which are reference-counted pointers that automatically break pointer cycles by not contributing to the reference count, thus addressing a common weakness in reference-counted garbage collection. Our experiments with a C++-library implementation show that our automatic techniques perform in line with their manual counterparts, and that our weak pointer implementation outperforms the best known atomic weak pointer library by up to an order of magnitude on high thread counts. All together, we show that the ease of use of automatic memory management can be achieved without significant cost to practical performance or general applicability.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/17/2017

A new and five older Concurrent Memory Reclamation Schemes in Comparison (Stamp-it)

Memory management is a critical component in almost all shared-memory, c...
research
08/15/2019

Counting Immutable Beans: Reference Counting Optimized for Purely Functional Programming

Most functional languages rely on some garbage collection for automatic ...
research
07/17/2023

Semantic Counting from Self-Collages

While recent supervised methods for reference-based object counting cont...
research
10/25/2018

Decoupling Lock-Free Data Structures from Memory Reclamation for Static Analysis

Verification of concurrent data structures is one of the most challengin...
research
05/21/2018

Stamp-it: A more Thread-efficient, Concurrent Memory Reclamation Scheme in the C++ Memory Model

We present Stamp-it, a new, concurrent, lock-less memory reclamation sch...
research
10/31/2022

Low-Latency, High-Throughput Garbage Collection (Extended Version)

Production garbage collectors make substantial compromises in pursuit of...
research
11/08/2022

The ERA Theorem for Safe Memory Reclamation

Safe memory reclamation (SMR) schemes for concurrent data structures off...

Please sign up or login with your details

Forgot password? Click here to reset