Higher-Order and Symbolic Computation, 12(1)7-45

Implementation Strategies for First-Class Continuations

William D. Clinger, College of Computer Science, Northeastern University, 360 Huntington Avenue, Boston, MA 02115
Anne H. Hartheimer
Eric M. Ost

Abstract: Scheme and Smalltalk continuations may have unlimited extent. This means that a purely stack-based implementation of continuations, as suffices for most languages, is inadequate. We review several implementation strategies for continuations and compare their performance using instruction counts for the normal case and continuation-intensive synthetic benchmarks for other scenarios, including coroutines and multitasking. All of the strategies constrain a compiler in some way, resulting in indirect costs that are hard to measure directly. We use related measurements on a set of benchmarks to calculate upper bounds for these indirect costs.

Keywords: continuations, stacks, heap allocation, coroutines, multitasking, Scheme, Smalltalk

This article can be downloaded [here].
[picture of journal cover]

June 2003 - hosc@brics.dk