Threads Yield Continuations

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.

[1]  Mitchell Wand,et al.  Continuation-Based Multiprocessing , 1980, High. Order Symb. Comput..

[2]  R. Kent Dybvig,et al.  Representing control in the presence of one-shot continuations , 1996, PLDI '96.

[3]  Daniel P. Friedman,et al.  Engines build process abstractions , 1984, LFP '84.

[4]  湯淺 太一,et al.  Indefinite One-time Continuation , 1995 .

[5]  C. A. R. Hoare,et al.  Monitors: an operating system structuring concept , 1974, CACM.

[6]  Christian Queinnec,et al.  A dynamic extent control operator for partial continuations , 1991, POPL '91.

[7]  William F. Clocksin,et al.  Programming in Prolog , 1987, Springer Berlin Heidelberg.

[8]  Robert Hieb,et al.  Representing control in the presence of first-class continuations , 1990, PLDI '90.

[9]  Christopher T. Haynes,et al.  Logic Continuations , 1986, J. Log. Program..

[10]  Mitchell Wand,et al.  Obtaining Coroutines with Continuations , 1986, Comput. Lang..

[11]  James S Miller MultiScheme: A Parallel Processing System Based on MIT (Massachusetts Institute of Technology) Scheme. , 1987 .

[12]  Butler W. Lampson,et al.  Experience with processes and monitors in Mesa , 1980, CACM.

[13]  Gerald J. Sussman,et al.  Scheme: A Interpreter for Extended Lambda Calculus , 1998, High. Order Symb. Comput..

[14]  Daniel Weise,et al.  Continuing into the future: on the interaction of futures and first-class continuations , 1990, LISP and Functional Programming.

[15]  Olivier Danvy,et al.  Representing Control: a Study of the CPS Transformation , 1992, Mathematical Structures in Computer Science.

[16]  Matthias Felleisen,et al.  Control delimiters and their hierarchies , 1990, LISP Symb. Comput..

[17]  Robert H. Halstead,et al.  MULTILISP: a language for concurrent symbolic computation , 1985, TOPL.

[18]  Robert Hieb,et al.  Continuations and concurrency , 1990, PPOPP '90.

[19]  Suresh Jagannathan,et al.  A customizable substrate for concurrent languages , 1992, PLDI '92.

[20]  Robert Hieb,et al.  Engines From Continuations , 1989, Comput. Lang..

[21]  Suresh Jagannathan,et al.  A foundation for an efficient multi-threaded scheme system , 1992, LFP '92.

[22]  Didier Rémy,et al.  A generalization of exceptions and control in ML-like languages , 1995, FPCA '95.

[23]  Slocum Miller James,et al.  Multischeme : a parallel processing system based on MIT scheme , 1987 .

[24]  James J. Horning,et al.  Synchronization Primitives for a Multiprocessor: A Formal Speci cation , 1987 .

[25]  Andrew Tolmach,et al.  A Portable Multiprocessor Interface for Standard ML of New Jersey , 1992 .

[26]  Gerald Jay Sussman,et al.  An Interpreter for Extended Lambda Calculus , 1975 .

[27]  Matthias Felleisen,et al.  The theory and practice of first-class prompts , 1988, POPL '88.

[28]  R. Kent Dybvig,et al.  Threads Yield Continuations , 1998, LISP Symb. Comput..

[29]  Matthias Felleisen,et al.  Abstract continuations: a mathematical semantics for handling full jumps , 1988, LISP and Functional Programming.

[30]  J. Gregory Morrisett,et al.  Adding threads to Standard ML , 1990 .