Skip to main content
QUICK REVIEW

[论文解读] Sequential Consistency and Concurrent Data Structures

Ali Sezgin|arXiv (Cornell University)|Jun 16, 2015
Distributed systems and fault tolerance被引用 3
一句话总结

本文研究了顺序一致性(SC)作为并发数据结构中线性一致性的一种较弱替代方案,揭示了SC允许存在无需同步即可运行的平凡错误实现。为解决此问题,作者提出了k-SC——一种对SC的量化强化,强制每条线程在最多k个本地事件后进行同步,从而在SC与线性一致性之间建立可扩展的层次结构。

ABSTRACT

Linearizability, the de facto correctness condition for concurrent data structure implementations, despite its intuitive appeal is known to lead to poor scalability. This disadvantage has led researchers to design scalable data structures satisfying consistency conditions weaker than linearizability. Despite this recent trend, sequential consistency as a strictly weaker consistency condition than linearizability has received no interest. In this paper, we investigate the applicability of sequential consistency as an alternative correctness criterion for concurrent data structure implementations. Our first finding formally justifies the reluctance in moving towards sequentially consistent data structures: Implementations in which each thread modifies only its thread-local variables are sequentially consistent for various standard data structures such as pools, queues and stacks. We also show that for almost all data structures, and the data structures we consider in this paper, it is possible to have sequentially consistent behaviors in which a designated thread does not synchronize at all. As a potential remedy, we define a hierarchy of quantitatively strengthened variants of sequential consistency such that the stronger the variant the more synchronization it enforces which at the limit is equal to that enforced by linearizability.

研究动机与目标

  • 评估顺序一致性(SC)作为并发数据结构正确性准则的可行性,尽管其在理论上具有吸引力。
  • 识别SC中固有的缺陷,这些缺陷允许在标准数据结构中出现非同步和语义上错误的行为。
  • 提出SC的量化改进——k-SC,通过强制周期性同步来防止病态实现。
  • 通过限制非同步时间区间,建立SC与线性一致性之间的形式化层次结构。
  • 证明常见数据结构(如队列、栈和池)易受SC缺乏强制机制的影响。

提出的方法

  • 将鲁棒性定义为方法序列的一种属性,即无论数据结构的当前状态如何,其有效性均保持不变。
  • 引入可组合性作为数据结构的一种结构性质,即任意两个有效行为可交错组合成另一个有效行为。
  • 构建SC实现,使得若某线程的本地事件序列具有鲁棒性,则其可无限期延迟同步。
  • 提出k-SC:一种SC变体,要求每条线程在每k个本地事件后至少同步一次。
  • 设计k-SC的模板算法,该算法在本地缓冲操作,并在达到k个事件或违反鲁棒性时原子提交。
  • 形式化定义k-串行历史以刻画k-SC,其中0-SC等价于线性一致性。

实验结果

研究问题

  • RQ1对于像队列、栈和池这样的常见数据结构,其顺序一致性实现是否可能因缺乏同步而表现出语义上错误的行为?
  • RQ2在何种结构条件下(例如可组合性、鲁棒性)下,SC实现无法强制执行有意义的同步?
  • RQ3是否存在一种方法,可对SC进行量化强化,以防止孤立的、不进行同步的线程,同时保持可扩展性?
  • RQ4k-SC与线性一致性之间有何关系?它能否作为实际的中间一致性条件?
  • RQ5能否通过本地缓冲和原子提交机制在实践中有效实现k-SC?

主要发现

  • 对于所有标准数据结构(池、队列、栈、寄存器),均存在顺序一致性实现,其中某线程可执行任意长的无同步序列。
  • 在可组合数据结构(如队列和栈)中,完全非同步的实现是顺序一致的,导致程序行为错误,例如未处理的任务。
  • 鲁棒序列(例如push、enqueue)的存在使得线程可独立执行操作而不影响SC下的正确性。
  • k-SC的形式化定义要求线程每k个事件内至少同步一次,其中0-SC等价于线性一致性。
  • k-SC模型在SC与线性一致性之间提供了一个连续的谱系,支持具有有界非同步时间的可扩展实现。
  • k-SC模板可通过修改现有单一实现,结合本地缓冲和阈值或鲁棒性违反时的原子提交机制来实现。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。