2008 · 11 citations · 24 references
ComputingComputer ScienceCompilersProgramming LanguagesSyntaxConcurrent ProgrammingSynchronization PrimitivesThread ProgrammingConcurrency SemanticsContinuation SemanticsSynchronization SemanticsSystem Call Abstractions
Abstract It is possible to integrate Scheme-style first-class continuations andthreads in a systematic way. We expose the design choices, discuss their consequences, and present semantical frameworks that spec-ify the behavior of Scheme programs in the presence of threads. While the issues concerning the addition of threads to Scheme-like languages are not new, many questions have remained open. Among the pertinent issues are the exact relationship between con-tinuations and the call-with-current-continuation primi-tive, the interaction between threads, first-class continuations, and dynamic-wind, the semantics of dynamic binding in the presenceof threads, and the semantics of thread-local store. Clarifying these issues is important because the design decisions related to themhave profound effects on the programmer's ability to write modular abstractions. 1 What's in a Continuation? Scheme [21] was one the first languages to endorse call-with-current-continuation as a primitive. Callwith-current-continuation (or call/cc, for short) is anessential ingredient in the implementation of a wide range of useful abstractions, among them non-local control flow, exceptionsystems, coroutines, non-deterministic computation, and Web programming session management. So much is often repeated,non-controversial and clear. Nowadays, even the name call-with-current-continuationis confusing. It suggests erroneously that call/cc applies its ar-gument to a reified version of the current continuation--the metalevel object the underlying machine uses to remember what shouldhappen with the value of the expression currently being evaluated.
24