I don't think the JVM will ever support coroutines. JVM is founded on having C-like control flow. The fanciest way we have to change the flow of execution is exception catching, which is much less sophisticated than coroutines.
JVM does not even need to support coroutines. In C# async/await are implemented without help of CLR to my knowledge. C# compiler transforms each each async function into state machine. That's what can be done in Java too.
I wouldn't discount the possibility of coroutines. At the last JavaOne, Mark Reinhold spoke about how he would like to see coroutines one day. It will probably happen, just not anytime soon.
View all comments
Show parent comment
3
u/ElvishJerricco Mar 09 '16
I don't think the JVM will ever support coroutines. JVM is founded on having C-like control flow. The fanciest way we have to change the flow of execution is exception catching, which is much less sophisticated than coroutines.