Coro in Java 8

Charles Oliver Nutter headius at headius.com
Wed Apr 27 11:33:40 PDT 2011


I think it's time to start talking about what we'd need to do to get
coroutines in Java 8.

In the absence of forking, lightweight processes, or M:N threading,
there's no efficient way to implement a large set of problems that
demand fiber/coroutine-like behavior. Add to that the fact that
languages like Ruby and Erlang already want for "fibers", and in JRuby
and Erjang we have to hack around the JVM to support them.

With the narrowing of Lucas's patch to downstream coroutines (rather
than unbounded continuations) I believe most of the concerns about
security have been addressed. Or at least, enough of those concerns
have been addressed that we need to get this patch in front of more
people to find new concerns.

So, I guess what's needed would be at least a JSR, which then needs
someone to lead it (I don't think we'd have much trouble getting
people to participate).

Any thoughts on trying to push coro through to Java 8 as an official
feature? I'm convinced it needs to happen.

- Charlie


More information about the mlvm-dev mailing list