论文标题

合成隐式监视器的细粒度同步协议(扩展版)

Synthesizing Fine-Grained Synchronization Protocols for Implicit Monitors (Extended Version)

论文作者

Ferles, Kostas, Sepanski, Benjamin, Krishnan, Rahul, Bornholt, James, Dillig, Isil

论文摘要

监视器是一种广泛使用的并发编程抽象,可封装线程之间的所有共享状态。可以根据其提供的原始词而将监视器归为隐性或明确。隐式监视器更容易编程,但通常不那么高效。为了解决这一差距,最近有关于自动从隐式规范中自动合成显式信号监视器的研究,但是先前的工作并没有利用由于整个监视器使用单个锁定而导致的所有瘫痪机会。本文提出了一种新技术,用于合成隐式监视器的细粒度显式同步协议。我们的方法基于两个关键创新:首先,我们提出了一种新的静态分析,用于推断安全的交通,该分析允许违反监视器操作而无需更改其语义。其次,我们使用此静态分析的结果来生成一个MaxSAT实例,该实例的模型对应于正确的构造同步协议。我们已经在一种名为Cortado的工具中实施了我们的方法,并在包含并行机遇的监视器上对其进行了评估。我们的评估表明,Cortado可以综合与这些基准上的专家写的同步策略,甚至比专家写的策略更好。

A monitor is a widely-used concurrent programming abstraction that encapsulates all shared state between threads. Monitors can be classified as being either implicit or explicit depending on the primitives they provide. Implicit monitors are much easier to program but typically not as efficient. To address this gap, there has been recent research on automatically synthesizing explicit-signal monitors from an implicit specification, but prior work does not exploit all paralellization opportunities due to the use of a single lock for the entire monitor. This paper presents a new technique for synthesizing fine-grained explicit-synchronization protocols from implicit monitors. Our method is based on two key innovations: First, we present a new static analysis for inferring safe interleavings that allow violating mutual exclusion of monitor operations without changing its semantics. Second, we use the results of this static analysis to generate a MaxSAT instance whose models correspond to correct-by-construction synchronization protocols. We have implemented our approach in a tool called Cortado and evaluate it on monitors that contain parallelization opportunities. Our evaluation shows that Cortado can synthesize synchronization policies that are competitive with, or even better than, expert-written ones on these benchmarks.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源