并发集合中的垃圾回收
Garbage Collection in Concurrent Sets
摘要:
并发数据结构中的垃圾回收,特别是无锁数据结构,提出了多个设计和一致性挑战。在这种情况下,我们考虑并发集的情况。集合是元素的集合,其中元素是有序且不同的。这两个不变量在每一个时间点上总是保持不变的。目前,已经存在多个并发集的实现。LazyList、Hand-over-hand List和Harris List是一些著名的实现。然而,这些实现都没有采用或关注已删除节点的垃圾回收。相反,每个实现都会忽略删除的节点,或者依赖于语言的垃圾收集器来处理它们。此外,并发列表中的垃圾回收(使用乐观遍历或无锁)并不简单。例如,在LazyList和Harris List中,它们允许线程在这些节点已经从列表中删除(因此可能被删除)之后遍历节点或节点序列。如果删除的节点被重用,这将可能导致ABA问题。此外,有些语言(如C++)没有内置的垃圾收集器。某些构造(如共享指针)提供了有限的垃圾回收功能,但它会大幅度降低性能。将共享指针集成到并发代码中也不是一个简单的任务。在本文中,我们提出了一个新的表示的并发集,GCList,它采用内置的垃圾回收。我们提出了一种新的垃圾回收计划,实现了内置的内存回收,从而重用从列表中删除的节点。我们提出了基于锁和无锁的GCList实现。垃圾回收方案与Set操作并行工作。
英文摘要:
Garbage Collection in concurrent data structures, especially lock-free ones, pose multiple design and consistency challenges. In this instance, we consider the case of concurrent sets. A set is a collection of elements, where the elements are ordered and distinct. These two invariants are always maintained at every point in time. Currently, multiple implementations of concurrent sets already exist. LazyList, Hand-over-hand List and Harris List are some of the well-known implementations. However none of these implementations employ, or are concerned with garbage collection of deleted nodes. Instead each implementation ignores deleted nodes or depends on the garbage collector of the language to handle them. Additionally, Garbage collection in concurrent lists, that use optimistic traversals or that are lock-free, is not trivial. For example, in LazyList and Harris List, they allow a thread to traverse a node or a sequence of nodes after these nodes have already been removed from the list, and hence possibly deleted. If deleted nodes are to be reused, this will potentially lead to the ABA problem. Moreover, some languages like C++ do not have an inbuilt garbage collector. Some constructs like Shared Pointers provide a limited garbage collection facility, but it degrades performance by a large scale. Integrating Shared Pointers into a concurrent code is also not a trivial task. In this paper, we propose a new representation of a concurrent set, GCList, which employs inbuilt garbage collection. We propose a novel garbage collection scheme that implements in-built memory reclamation whereby it reuses deleted nodes from the list. We propose both lock-based and lock-free implementations of GCList. The garbage collection scheme works in parallel with the Set operations.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。