Available Coroutine Libraries in Java

The Kilim framework implements coroutines by using byte code rewriting. I've used it myself to implement light-weight processes in Erjang, and it is very stable and surprisingly fast for the amount of bytecode rewriting that goes on.

Kilim's coroutines interact by using mailboxes, so I use the framework to model Erlang actors. But it can just as well be used to do coroutines in a shared memory model.


Javaflow is a continuation implementation, it will probably let you do that. It uses bytecode manipulation though.

Anyway, it feels like you're trying to do OOP with plain C. It's doable but it doesn't mean you should do it.

Tags:

Java

Coroutine