Abstract
In order to ensure atomicity and dependency of parallel programs, programmers are required to adopt synchronization schemes, but manual implementation is quite tedious and error-prone. Incorrect or unintended behaviors often result in concurrency bugs, e.g., deadlock. To resolve dependency among threads, this paper proposes SyncMHB, the first synchronization synthesizer for Must-Happen-Before (MHB) relations. According to the user-specified MHB relations, our SyncMHB can automatically identify deadlocks and then synthesizes corresponding implementation with low-level synchronization primitives, e.g., POSIX library. The experimental results show that our synthesized codes perform as well as those professionally hand-coded.