We present a general technique for garbage collecting old versions for multi-version concurrency control that simultaneously achieves good time and space complexity. Our technique takes only $O(1)$ time on average for each new version and maintains only a constant factor more than then number of needed versions. Our technique is designed for multi-version schemes using version lists, which are the most common. Our approach uses two components that are of independent interest. First, we define a novel range-tracking data structure which stores a set of old versions and efficiently finds those that are no longer needed. We provide a wait-free implementation in which all operations take amortized constant time. Second, we represent version lists using a new lock-free doubly-linked list algorithm that supports efficient (amortized constant time) removals given a pointer to any node in the list. These two components naturally fit together to solve the multiversion garbage collection problem--the range-tracker identifies which versions to remove and the list algorithm splices them out. We apply our garbage collection technique to generate end-to-end time and space bounds for the multiversioning system of Wei et al. (PPoPP 2021).
翻译:我们提出了一个收集旧版本的垃圾的通用技术,用于收集多种版本的旧版本,以便同时实现良好的时间和空间复杂性。我们的技术对每个新版本平均只需要一美元(1)美元的时间,并且只维持一个比当时需要的版本数量更多的不变因素。我们的技术是为使用最常见的版本列表的多版本计划设计的。我们的方法使用两个独立感兴趣的组成部分。首先,我们定义了储存一套旧版本并有效找到不再需要的旧版本的新的范围跟踪数据结构。我们提供了一种无等待的落实方法,所有操作都使用重新摊销的固定时间。第二,我们代表版本列表使用一个新的无锁的双链接列表算法,该算法支持高效(摊销的固定时间)清除到列表中的任何节点。这两个组成部分自然适合解决多版本垃圾收集问题—— 范围跟踪器确定哪些版本可以删除,而列表算法则可以将之切除。我们应用了垃圾收集技术来生成 Wei 等人 的多变量的终端到终端时间和空间框(PP 2021)。