论文标题
将手动并发记忆填充变成自动参考计数
Turning Manual Concurrent Memory Reclamation into Automatic Reference Counting
论文作者
论文摘要
安全记忆填海(SMR)方案是无锁数据结构和并发编程的重要工具。但是,众所周知,手动SMR方案很难正确应用,并且自动方案(例如参考计数)已经被争辩了十多年来,以至于实用目的太慢了。最近的一波工作已经反驳了这一长期以来的概念,并表明参考计数可以像危险指针一样可扩展,这是最常见的手动技术之一。尽管有这些巨大的改进,但这些方案之间的性能和更快的手动技术(例如基于时期的填海(EBR)(EBR))之间的性能仍然高达2倍或更多。 在这项工作中,我们首先提出了这些想法,并表明在许多情况下,自动参考计数实际上可能与最快的手动SMR技术一样快。我们将以前的并发递延参考计数(CDRC)算法概括为获得一种将任何标准手动SMR技术转换为具有相似性能配置文件的自动参考计数技术的方法。我们的第二个贡献是扩展该框架以支持弱指针,这些指针是参考计数的指针,它们通过不促进参考计数而自动打破指针周期,从而解决了参考计数的垃圾收集中的共同弱点。 我们使用C ++库实现的实验表明,我们的自动技术与他们的手动相一致,并且我们的弱指针实现的表现优于最著名的原子弱指针库,从而在高线程上的数量级。总之,我们表明可以实现自动内存管理的易用性,而无需大量实用性绩效或一般适用性。
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.