Is there a good implementation of continuations in Java?
If so, what is the overhead like? The JVM wasn't designed with these sort of things in mind, right? So is this kind of going against the grain?
See Apache Javaflow http://commons.apache.org/sandbox/javaflow/
It's the only continuation package for java that's actively under development. The other one, RIFE, I'm not sure which state it's in.
Javaflow http://commons.apache.org/sandbox/javaflow/ Play framework use Javaflow http://blog.heroku.com/archives/2011/8/29/play/
RIFE http://www.artima.com/lejava/articles/continuations.html WebWork use.
JauVM http://jauvm.blogspot.com/2005/07/so-what-does-it-do.html JVM in JVM, implements tail call / continuation
Scala 2.8 http://www.scala-lang.org/node/2096
Cocoon http://cocoon.apache.org/2.1/userdocs/flow/continuations.html http://wiki.apache.org/cocoon/RhinoWithContinuations
Jetty http://docs.codehaus.org/display/JETTY/Continuations retry request.
coroutines http://code.google.com/p/coroutines
jconts https://github.com/idubrov/jconts
jyield http://code.google.com/p/jyield
Kilim http://www.malhar.net/sriram/kilim/thread_of_ones_own.pdf
ATCT http://portal.acm.org/ft_gateway.cfm?id=949362
Jetty has continuation support. There is further discussion and some samples at DZone.
I can't advise on the efficiencies or otherwise, other than to say that the Mortbay team always appear concious of such issues. There will most likely be a discussion of implementation trade-offs somewhere on the Jetty site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With