-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GR-34749] Continuation support independent of Project Loom. #4114
Conversation
c4ec694
to
175adc8
Compare
1326b8c
to
82a59de
Compare
a6e156e
to
177f485
Compare
I wonder how it compares to Loom and Kotlin coroutines |
@LifeIsStrange this implementation is similar to that of Project Loom, but not optimized or well-tested yet. There are some potential advantages we have however, such as our monitor implementation using |
db39dc0
to
bcedb19
Compare
25d8798
to
bfa4894
Compare
…oid stuck threads.
…ys (almost) write interrupted flag even when already interrupted.
bfa4894
to
a9eb62c
Compare
a9eb62c
to
6828076
Compare
This change refactors our fundamental implementation of continuations so it does not require a Project Loom JDK, and adds our own implementation of virtual threads (as opposed to platform threads, i.e. OS threads). With no support in the JDK code for yielding a virtual thread when it blocks on I/O, we cannot ensure progress if we limit the number of backing platform threads, so in the worst case, the default backing thread pool creates a platform thread for each virtual thread. This, of course, currently makes virtual threads less viable for what continuations are usually intended for.
Future changes will refactor the structure of stored continuation stacks and avoid doing stack walks on them eagerly and instead let the garbage collector walk them on demand.