Continuing Into the Future: On the Interaction of Futures and First-Class Continuations
暂无分享,去创建一个
One of the nicest features of the future construct originally presented in Multilisp [2] is its near orthogonality with respect to a functional subset of Scheme [1]. Introducing futures into most functional programs does not affect the value returned, even though the parallel execution order might differ from the sequential. When futures and continuations are used in the same program, however, parallel and sequential executions can yield different results. No existing implementation of futures has yet addressed this issue. We make futures and continuations interact properly through a simple, yet important, change to the implementation of the future construct. This change causes a second problem to manifest itself: the creation of extraneous computation threads. The second problem is addressed by making an additional change to the future construct.
[1] Robert H. Halstead,et al. New Ideas in Parallel Lisp: Language Design, Implementation, and Programming Tools , 1989, Workshop on Parallel Lisp.
[2] Daniel Weise,et al. Continuing into the future: on the interaction of futures and first-class continuations , 1990, LISP and Functional Programming.
[3] Robert H. Halstead,et al. MULTILISP: a language for concurrent symbolic computation , 1985, TOPL.