Session

Continuations: The magic behind virtual threads in Java

Have you wondered how virtual threads in Java are able to provide such high scalability? How is JVM able to switch between so many virtual threads while executing a single platform thread? If you did then this talk is for you.

Continuations is the magic that powers Virtual Threads. A continuation can be viewed as a representation of the current state of the program or it can be viewed as a reference to the rest of the program. It helps us to pause execution of a program (or part thereof) and then resume it later. This ability to pause/resume is a powerful mechanism and is the basis for providing virtual threads.

The talk explains what Continuations are and where they are used. But more importantly, we write our own simple VirtualThread class using the Continuation API provided by JDK. This will give you clear idea about the role of continuations in the nature of virtual threads.

Balkrishna Rawool

IT Chapter Lead at ING Bank NV

Utrecht, The Netherlands

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top