Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Coroutine
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Java=== There are several implementations for coroutines in [[Java (programming language)|Java]]. Despite the constraints imposed by Java's abstractions, the JVM does not preclude the possibility.<ref name="jvmsummit">{{cite web|url=http://www.wiki.jvmlangsummit.com/images/2/2b/JVMLanguageSummit_Stadler_Continuations.pdf|author=Lukas Stadler|series=JVM Language Summit|title=JVM Continuations|year=2009|access-date=2011-10-03|archive-date=2012-04-23|archive-url=https://web.archive.org/web/20120423215434/http://wiki.jvmlangsummit.com/images/2/2b/JVMLanguageSummit_Stadler_Continuations.pdf|url-status=live}}</ref> There are four general methods used, but two break bytecode portability among standards-compliant JVMs. * Modified JVMs. It is possible to build a patched JVM to support coroutines more natively. The [http://openjdk.java.net/projects/mlvm/ Da Vinci JVM] has had patches created.<ref name="javanet-forax">{{cite web|url=http://weblogs.java.net/blog/forax/archive/2009/11/19/holy-crap-jvm-has-coroutinecontinuationfiber-etc|author=Remi Forax|archive-url=https://web.archive.org/web/20150319052055/http://weblogs.java.net/blog/forax/archive/2009/11/19/holy-crap-jvm-has-coroutinecontinuationfiber-etc|archive-date=19 March 2015|title=Holy crap: JVM has coroutine/continuation/fiber etc.|date=19 November 2009}}</ref> * Modified bytecode. Coroutine functionality is possible by rewriting regular Java bytecode, either on the fly or at compile time. Toolkits include [http://commons.apache.org/sandbox/commons-javaflow/ Javaflow], [http://code.google.com/p/coroutines/ Java Coroutines], and [https://github.com/offbynull/coroutines Coroutines]. * Platform-specific JNI mechanisms. These use JNI methods implemented in the OS or C libraries to provide the functionality to the JVM.{{citation needed|date=May 2014}} * Thread abstractions. Coroutine libraries which are implemented using threads may be heavyweight, though performance will vary based on the JVM's thread implementation.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)