面向以数据为中心的同步的可靠原子性推断
Sound Atomicity Inference for Data-Centric Synchronization
AI总结:
本文提出新型DCCC模型AtomiS,通过静态分析推断方法局部原子性约束并自动生成代码注入并发控制原语,解决了现有方案注解繁多且不支持接口的问题,并经Coq证明其类型可靠。
摘要:
以数据为中心的并发控制(DCCC)将对并发限制的推理从控制结构转移到数据声明上。这是一种高级的声明式方法,抽象掉了实际使用的并发控制机制。尽管具有诸多优势,但 DCCC 的实际应用却受到阻碍,因为它可能需要许多注解和/或对同一方法进行多次实现,以应对具有不同限定符的参数。此外,现有的 DCCC 解决方案未涉及接口的使用,从而阻碍了它们在大多数面向对象程序中的应用。为了克服这些限制,本文提出了 AtomiS,这是一种基于严格定义的类型可靠编程语言的新型 DCCC 模型。使用 AtomiS 进行编程仅需在接口定义中对参数和返回值的类型进行 (atomic) 限定,以及在类定义中对字段进行限定。基于该原子性规范,静态分析会推断每个方法局部的原子性约束,仅将与规范一致的方法变体视为有效,并为每个方法的所有有效变体执行代码生成。随后,生成的代码将成为自动注入并发控制原语的目标,这是通过所需的自动技术及相关的原子性与无死锁保证来实现的,这些技术可以插入到模型的流水线中。我们提出了 AtomiS 分析与综合的基础理论,并提供了形式化保证,证明生成的程序是类型良好的,且在行为上与原始程序一致。相关证明已在 Coq 中机械化。我们还提供了一个 Java 实现,展示了 AtomiS 在实际程序中的适用性。
英文摘要:
Data-Centric Concurrency Control (DCCC) shifts the reasoning about concurrency restrictions from control structures to data declaration. It is a high-level declarative approach that abstracts away from the actual concurrency control mechanism(s) in use. Despite its advantages, the practical use of DCCC is hindered by the fact that it may require many annotations and/or multiple implementations of the same method to cope with differently qualified parameters. Moreover, the existing DCCC solutions do not address the use of interfaces, precluding their use in most object-oriented programs. To overcome these limitations, in this paper we present AtomiS, a new DCCC model based on a rigorously defined type-sound programming language. Programming with AtomiS requires only (atomic)-qualifying types of parameters and return values in interface definitions, and of fields in class definitions. From this atomicity specification, a static analysis infers the atomicity constraints that are local to each method, considering valid only the method variants that are consistent with the specification, and performs code generation for all valid variants of each method. The generated code is then the target for automatic injection of concurrency control primitives, by means of the desired automatic technique and associated atomicity and deadlock-freedom guarantees, which can be plugged-into the model's pipeline. We present the foundations for the AtomiS analysis and synthesis, with formal guarantees that the generated program is well-typed and that it corresponds behaviourally to the original one. The proofs are mechanised in Coq. We also provide a Java implementation that showcases the applicability of AtomiS in real-life programs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。