loom ea based jdk18 feedback
Ron Pressler
ron.pressler at oracle.com
Wed Nov 17 15:38:17 UTC 2021
> On 17 Nov 2021, at 11:13, dreamlike_ocean lei <dreamlike.vertx at gmail.com> wrote:
>
> 1, continuation api
>
>
> I really hope I can directly access this api in the future version
The Continuation class is fundamentally unsafe, and using it might result in miscompilation, as the JIT compiler bases some optimisations on the assumption that the current thread cannot change. So there is currently no way of exposing this particular class (which is mostly of interest for research). However, in the future, the JDK could conceivably add safe abstractions built on top of Continuation other than virtual threads, that would probably be confined to a single thread. Custom schedulers will be able to give you what I believe you want.
>
> Virtual thread custom scheduler
>
>
> I hope you can consider reopening the api of the custom scheduler in the
> future version
That is an API we would very much like to have, but we haven’t had time to review yet. I don’t know yet whether or not it will make it in time for the first release. Note that this is a very specialised API for internal, sophisticated, use by frameworks, only, and should rarely if ever be used by user code. Naturally, we prioritise the user-facing APIs.
— Ron
More information about the loom-dev
mailing list