A type and effect system for determinism in multithreaded programs

  • Authors:
  • Yi Lu;John Potter;Chenyi Zhang;Jingling Xue

  • Affiliations:
  • University of New South Wales, Australia;University of New South Wales, Australia;University of Queensland, Australia;University of New South Wales, Australia

  • Venue:
  • ESOP'12 Proceedings of the 21st European conference on Programming Languages and Systems
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

There has been much recent interest in supporting deterministic parallelism in imperative programs. Structured parallel programming models have used type systems or static analysis to enforce determinism by constraining potential interference of lexically scoped tasks. But similar support for multithreaded programming, where threads may be ubiquitously spawned with arbitrary lifetimes, especially to achieve a modular and manageable combination of determinism and nondeterminism in multithreaded programs, remains an open problem. This paper proposes a simple and intuitive approach for tracking thread interference and capturing both determinism and nondeterminism as computational effects. This allows us to present a type and effect system for statically reasoning about determinism in multithreaded programs. Our general framework may be used in multithreaded languages for supporting determinism, or in structured parallel models for supporting threads. Even more sophisticated concurrency models, such as actors, are often implemented on top of an underlying threading model, thus the underlying ideas presented here should be of value in reasoning about the correctness of such implementations.