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

03/01/2022
by   Kostas Ferles, et al.
0

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.

READ FULL TEXT
research
04/07/2018

Symbolic Reasoning for Automatic Signal Placement (Extended Version)

Explicit signaling between threads is a perennial cause of bugs in concu...
research
11/22/2021

A Formally-Verified Framework for Fair Synchronization in Kotlin Coroutines

Writing concurrent code that is both correct and efficient is notoriousl...
research
04/13/2021

Supporting Multiprocessor Resource Synchronization Protocols in RTEMS

When considering recurrent tasks in real-time systems, concurrent access...
research
06/27/2023

CASEIN: Cascading Explicit and Implicit Control for Fine-grained Emotion Intensity Regulation

Existing fine-grained intensity regulation methods rely on explicit cont...
research
05/20/2023

Locksynth: Deriving Synchronization Code for Concurrent Data Structures with ASP

We present Locksynth, a tool that automatically derives synchronization ...
research
04/06/2023

ImageEye: Batch Image Processing Using Program Synthesis

This paper presents a new synthesis-based approach for batch image proce...
research
09/13/2021

Specifying and Testing GPU Workgroup Progress Models

As GPU availability has increased and programming support has matured, a...

Please sign up or login with your details

Forgot password? Click here to reset