Continuations for the JVM

With the popularity of Ruby and the impending Open Sourcing of Sun's JVM, it's time to restart efforts to add continuations to the Java VM (which should have had them in the first place).


Several of the world's best computer language depend on continuations (and hence have had second class implementations on the JVM).


People who might be interested and/or able to further this process:


There are quite a few papers addressing continuation implementation and some that discuss it specifically with regard to the Java VM.


Migratory Threads

Those folks at INRIA have implemented their migratory threads (which sound like continuations to me) and have instrumented it to demonstrate that they in fact have no overhead. Their work extends the Sun JVM and binaries are freely available. Commercial restrictions and Sun Research license restrictions are a problem.

INRIA Migratory Threads

Sara Bouchenak, Daniel Hagimont, Noel De Palma. Techniques for Implementing Efficient Java Thread Serialization.

Thread Serialization


Persistent Java (PJama)

An early project that implemented a persistent JVM for all Java types (including classes and threads). Moribund because is was bound by the Sun Research License, but with OSS Java perhaps it can be revived.

Web Continuations

With the JVM stuck, the implementations of continuations in Java has focused on web containers.

Torsten called for a JSR for adding native support for continuations back in 2004. That didn't seem to get anywhere, but his work on continuation compilation has led to javaflow

Jetty 6 has continuations too

RIFE also has web continuations. It is used in WebWork.

Bracha'a blog entry on why Sun won't do continuations has many comments and is the first Google hit for "continuations in the java vm".


JESSICA2 is a distributed JVM implementing thread migration based on Kaffe.


Note that Continuations are quite different from Closures.

Interview with Neal Gafter made following his presentation about adding closures to Java,