JavaJava
Hands-on Lab120min
INTERMEDIATE

Developing an Asynchronous Application with Virtual Threads and Structured Concurrency

This lab explores JDK 21 Virtual Threads from Project Loom, showing how they enable scalable, thread-per-request applications with simpler, more maintainable code compared to reactive programming. Participants will build a virtual thread-based app using structured concurrency and scoped values, and compare its patterns and performance to traditional reactive approaches.

Ana-Maria Mihalceanu
Ana-Maria MihalceanuOracle
José Paumard
José PaumardOracle

talkDetail.whenAndWhere

Wednesday, October 8, 16:40-18:40
BOF 2
talks.description
One of the most exciting features delivered by JDK 21 are Virtual Threads, developed by the Loom project. They promise to enable the "simple thread-per-request style to scale with near-optimal hardware utilization". Before Virtual Threads, this could only be achieved with reactive programming, which provides excellent throughput, but with patterns that are difficult to write, read, debug, and profile. It offers outstanding performance, but at the expense of maintainability. This hands-on lab guides you through writing a virtual thread-based application that utilizes structured concurrency to parallelize requests and scoped values to pass sensitive information without relying on method parameters. You will see the patterns of code that the Loom project gives you to achieve the same throughput as a classical reactive application. You will then be able to compare the code patterns of both approaches to choose which one you prefer.
threads
loom
concurrency
reactive
talks.speakers
Ana-Maria Mihalceanu

Ana-Maria Mihalceanu

Oracle

Netherlands

Ana is a Java Champion Alumni, Developer Advocate for the Java Platform Group at Oracle, guest author of the book "DevOps tools for Java Developers", and a constant adopter of challenging technical scenarios involving Java-based frameworks and multiple cloud providers. She actively supports technical communities' growth through knowledge sharing and enjoys curating content for conferences as a program committee member. To learn more about/from her, follow her on Twitter @ammbra1508.
José Paumard

José Paumard

Oracle

France

José is a Java Developer Advocate at Oracle. He holds a PhD in applied mathematics and computer science. He has been an assistant professor at the University Sorbonne Paris Nord for 25 years. He is an active member of the Paris Java User Group, and a disorganizer of the JChateau unconference. He contributes Java learning content on the dev.java website. He publishes "Java Coding Tips", a biweekly series of shorts, and the "JEP Café", a video series, both on the Java YouTube channel.
comments.title

comments.speakerNotEnabledComments