@inproceedings{b2465cbf8d2841209d082c1f1ec3f34b,
title = "A Fast Wait-Free Solution to Read-Reclaim Races in Reference Counting",
abstract = "Reference counting is a safe alternative to manual memory management for multithreaded programs, and is supported by the standard libraries of several major programming languages (e.g., Arc in Rust, shared_ptr and atomic<shared_ptr> in C++). In concurrent reference counting, read-reclaim races, where a read of a mutable variable races with a write that deallocates the old value, require special handling: use-after-free errors occur if the object is deallocated by the writing thread before the reading thread can increment the reference count. Existing solutions are not wait-free, have a space overhead and/or take time linear in the number of threads for updates. We introduce an implementation for concurrent reference counting with no delayed reclamation, which is wait-free, easy to implement and fast in practice. Writes operate in constant time and reads usually in constant time, and in the worst-case, linear with respect to the number of threads that actually work with the variable. Our algorithm is based on the split reference count technique, which is used in production but is only lock-free. We re-explain this technique as a special case of weighted reference counting, to arrive at a simpler explanation of this technique that is often claimed to be difficult. We show that our algorithm works well in practice by benchmarking it against other implementations.",
keywords = "Concurrency, Reference counting, Wait-free",
author = "{de Wolff}, {Ivo Gabe} and Daniel Anderson and Keller, {Gabriele K.} and Aleksei Seletskiy",
note = "Publisher Copyright: {\textcopyright} The Author(s), under exclusive license to Springer Nature Switzerland AG 2024.; 30th International Conference on Parallel and Distributed Computing, Euro-Par 2024 ; Conference date: 26-08-2024 Through 30-08-2024",
year = "2024",
month = aug,
day = "26",
doi = "10.1007/978-3-031-69583-4_8",
language = "English",
isbn = "978-3-031-69582-7",
series = "Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)",
publisher = "Springer",
pages = "103--118",
editor = "Jesus Carretero and Javier Garcia-Blas and Sameer Shende and Ivona Brandic and Katzalin Olcoz and Martin Schreiber",
booktitle = "Euro-Par 2024",
address = "Germany",
}