Continuation classes in JDK 19 loom

Remi Forax forax at univ-mlv.fr
Fri Feb 4 14:34:20 UTC 2022


----- Original Message -----
> From: "Viraj Shetty" <shetty_viraj at yahoo.com>
> To: "loom-dev" <loom-dev at openjdk.java.net>
> Sent: Thursday, February 3, 2022 2:22:16 PM
> Subject: Continuation classes in JDK 19 loom

> Hello All –
> 
> I downloaded the JDK 19 version of the Loom and started playing with it. I saw
> that the Continuation related classes moved to internal packages. Previously
> this used to be in java.lang package - jdk.internal
> 
> Is there a way to directly access them to experiment with Continuations ?

You can still open jdk.internal using the command line if it's for experimenting.

Otherwise, i've tried to re-implement the Continuation API on top of the virtual thread API,
it seems to work, the idea is to have an executor using the current thread and create a virtual thread on that executor using the non public API.

https://github.com/forax/loom-fiber/blob/master/src/main/java/fr/umlv/loom/continuation/Continuation.java

> 
> Thanks,
> Viraj

regards,
Rémi


More information about the loom-dev mailing list