We introduce GCAS, a natural generalization of the well-known compare-and-swap (CAS) object. Intuitively, GCAS just replaces the fixed equality test of CAS with a parametrized comparator chosen from $\{<, =, >\}$. To showcase the utility of GCAS, we present two space-efficient wait-free universal constructions for systems where the number of participating processes is unknown and may be infinite (the infinite-arrival model). The first has space-complexity linear in the number of processes that have participated so far, while the second has space-complexity linear in the point contention but assumes bounded concurrency. To the best of our knowledge, these are the first wait-free universal constructions that achieve this space complexity in the infinite-arrival model. To achieve space complexity linear in the point contention, our second universal construction uses a novel memory recycling scheme that works in the infinite-arrival model with bounded concurrency. The ideas behind this recycling scheme could be of more general use.
翻译:我们提出GCAS,这是对众所周知的比较交换(CAS)对象的一种自然推广。直观上,GCAS仅将CAS的固定相等性检验替换为从{<, =, >}中选择的参数化比较器。为展示GCAS的实用性,我们针对参与进程数量未知且可能无限的系统(无限到达模型),提出了两种空间高效的无等待通用构造。第一种构造的空间复杂度与迄今为止参与进程的数量成线性关系;第二种构造的空间复杂度与点竞争度成线性关系,但假设有界并发性。据我们所知,这是在无限到达模型中实现该空间复杂度的首批无等待通用构造。为达到与点竞争度成线性关系的空间复杂度,我们的第二种通用构造采用了一种新颖的内存回收方案,该方案可在有界并发性的无限到达模型中工作。该回收方案背后的思想可能具有更广泛的用途。