Compiler support for lightweight concurrency

Abstract

This paper describes the design of a direct-style, lambda-calculus-based compiler intermediate representation (IR) suitable for implementing a wide range of surface-language concurrency features while allowing flexibility in the back-end implementation. The features that this IR includes to support concurrency include a weak but inexpensive form of continuations and primitives for thread creation, scheduling, and termination. Although this work has been done in the context of implementing concurrency for the Moby programming language, the model is general and could be used in the context of other languages. In this paper, we describe the IR's continuations and thread manipulation primitives and illustrate their expressiveness with examples of various concurrency operations. We define an operational semantics to specify the operations precisely and to provide a tool for reasoning about the correctness of implementations. To illustrate the flexibility of our the approach, we describe two existing implementations of the threading model --- one based on a one-to-one mapping of language threads to POSIX threads and one based on a many-to-many mapping.


Last modified: April 6, 2004.
Comments to: John Reppy