基于可见性的弱一致性
Verifying Visibility-Based Weak Consistency
摘要:
多线程程序通常利用高效且线程安全的并发对象,如集合、键值映射和队列。虽然一些并发对象操作被设计为原子行为,每个操作都以线性化顺序见证了前一个操作的原子效果,但其他操作则放弃了这种强一致性,以避免复杂的控制和同步瓶颈。例如,键值映射的contains(value)方法可以遍历键值条目而不阻塞并发更新,以避免不必要的性能瓶颈,从而忽略一些线性化顺序的前导的影响。虽然这种弱一致性操作可能不是原子的,但它们仍然提供保证,例如,只观察已经存在的值。在这项工作中,我们开发了一种方法来证明并发对象实现坚持弱一致性规范。特别是,我们考虑(前向)基于模拟的证明,实现对放松可见性规范,允许指定的操作忽略一些线性化顺序的前辈,即,表现得好像它们从未发生过一样。除了注释实现代码以标识线性化点之外,操作的逻辑效果发生的点,我们还注释代码以标识可见操作,即,其效果被观察到的操作;在实践中,可以通过跟踪写入器到每个被访问的存储器位置来自动地完成该注释。我们正式我们的方法过渡系统的一般概念,不可知的任何特定的程序设计语言或内存模型,并证明其应用程序,使用自动定理证明,验证模型的Java并发对象实现。
英文摘要:
Multithreaded programs generally leverage efficient and thread-safe concurrent objects like sets, key-value maps, and queues. While some concurrent-object operations are designed to behave atomically, each witnessing the atomic effects of predecessors in a linearization order, others forego such strong consistency to avoid complex control and synchronization bottlenecks. For example, contains (value) methods of key-value maps may iterate through key-value entries without blocking concurrent updates, to avoid unwanted performance bottlenecks, and consequently overlook the effects of some linearization-order predecessors. While such weakly-consistent operations may not be atomic, they still offer guarantees, e.g., only observing values that have been present. In this work we develop a methodology for proving that concurrent object implementations adhere to weak-consistency specifications. In particular, we consider (forward) simulation-based proofs of implementations against relaxed-visibility specifications, which allow designated operations to overlook some of their linearization-order predecessors, i.e., behaving as if they never occurred. Besides annotating implementation code to identify linearization points, i.e., points at which operations' logical effects occur, we also annotate code to identify visible operations, i.e., operations whose effects are observed; in practice this annotation can be done automatically by tracking the writers to each accessed memory location. We formalize our methodology over a general notion of transition systems, agnostic to any particular programming language or memory model, and demonstrate its application, using automated theorem provers, by verifying models of Java concurrent object implementations.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。