LISP and Symbolic Computation, 7(1)83-110
Subcontinuations
Robert Hieb, Indiana University Computer Science Department, Bloomington, IN 47405
R. Kent Dybvig, Indiana University Computer Science Department, Bloomington, IN 47405
Claude W. Anderson, III, Rose-Hulman Institute of Technology Computer Science Department, Terre Haute, Indiana 47803
Abstract: Continuations have proven to be useful for
implementing a variety of control structures, including exception
handling facilities and breadth-first searching algorithms. However,
traditional continuations are not useful in the presence of
concurrency, because the notion of the rest of the computation
represented by a continuation does not in general make
sense. Traditional continuations can also be difficult to use in
nonconcurrent settings, since their global nature is sometimes
problematic. This article presents a new type of continuation, called
a subcontinuation. Just as a traditional continuation represents the
rest of a computation from a given point in the computation, a
subcontinuation represents the rest of a subcomputation from a given
point in the subcomputation. Subcontinuations may be used to control
tree-structured concurrency by allowing nonlocal exits to arbitrary
points in a process tree and allowing the capture of a subtree of a
computation as a composable continuation for later use. In the absence
of concurrency the localized control achievable with subcontinuations
makes them more useful than traditional continuations.
Keywords: continuations, control structure, control delimiters,
concurrency, engines, scheme
|
[local copy]
|
|