Threads Yield Continuations

  • Authors:
  • Sanjeev Kumar;Carl Bruggeman;R. Kent Dybvig

  • Affiliations:
  • Department of Computer Science, Princeton University, Princeton, NJ 08544 USA. E-mail: skumar@cs.princeton.edu;Department of Computer Science and Engineering, University of Texas at Arlington, Arlington, TX 76019-0015 USA. E-mail: bruggema@cse.uta.edu;Computer Science Department, Indiana University, Bloomington, IN 47405 USA. E-mail: dyb@cs.indiana.edu

  • Venue:
  • Lisp and Symbolic Computation
  • Year:
  • 1998

Quantified Score

Hi-index 0.00

Visualization

Abstract

Just as a traditional continuation represents the rest of acomputation from a given point in the computation, a subcontinuationrepresents the rest of a subcomputation from agiven point in the subcomputation. Subcontinuationsare more expressive than traditional continuations and have been shown to beuseful for controlling tree-structured concurrency, yet they havepreviously been implemented only on uniprocessors. This article describes aconcurrent implementation of one-shot subcontinuations. Like one-shotcontinuations, one-shot subcontinuations are first-class but may be invokedat most once, a restriction obeyed by nearly all programs that usecontinuations. The techniques used to implement one-shot subcontinuationsmay be applied directly to other one-shot continuation mechanisms and may begeneralized to support multi-shot continuations as well. A novel feature ofthe implementation is that continuations are implemented in terms ofthreads. Because the implementation model does not rely upon any speciallanguage features or compilation techniques, the model is applicable toany language or language implementation that supports a small set of threadprimitives.