Deadlock-Free channels and locks

  • Authors:
  • K. Rustan M. Leino;Peter Müller;Jan Smans

  • Affiliations:
  • Microsoft Research, Redmond, WA;ETH Zurich, Switzerland;KU Leuven, Belgium

  • Venue:
  • ESOP'10 Proceedings of the 19th European conference on Programming Languages and Systems
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

The combination of message passing and locking to protect shared state is a useful concurrency pattern. However, programs that employ this pattern are susceptible to deadlock. That is, the execution may reach a state where each thread in a set waits for another thread in that set to release a lock or send a message. This paper proposes a modular verification technique that prevents deadlocks in programs that use both message passing and locking. The approach prevents deadlocks by enforcing two rules: (0) a blocking receive is allowed only if another thread holds an obligation to send and (1) each thread must perform acquire and receive operations in accordance with a global order. The approach is proven sound and has been implemented in the Chalice program verifier.