Christian Woerz

Java 21: The Revolution of Virtual Threads - A Deep Dive

What if your simple, blocking code could handle millions of requests? See how virtual threads deliver massive scalability without the complexity of reactive programming.

Java 21: The Revolution of Virtual Threads - A Deep Dive
#1about 6 minutes

Building a traditional blocking web application

A live coding demonstration shows how to build a standard blocking API with Spring Boot and how its performance degrades under load.

#2about 5 minutes

Understanding the limitations of platform threads

Creating thousands of traditional platform threads demonstrates their high memory consumption, 1:1 mapping to OS threads, and eventual OutOfMemoryError.

#3about 12 minutes

Improving performance with a reactive approach

Refactoring the blocking API to use asynchronous programming with CompletableFuture solves the performance bottleneck but introduces significant code complexity.

#4about 7 minutes

How virtual threads solve the concurrency problem

Virtual threads are lightweight, JVM-managed threads that run on a small pool of carrier threads, enabling millions of concurrent tasks without high memory overhead.

#5about 4 minutes

Enabling virtual threads in a Spring Boot application

A single configuration flag in Spring Boot 3.2 is all that's needed to switch the application to use virtual threads for handling requests.

#6about 8 minutes

Managing parallel tasks with structured concurrency

StructuredTaskScope provides a modern API to run multiple blocking operations concurrently in separate virtual threads, simplifying parallel code.

#7about 4 minutes

Understanding the limitations of virtual threads

Virtual threads can be "pinned" to their carrier thread by synchronized blocks, native calls, or CPU-intensive tasks, which negates their benefits.

Related jobs
Jobs that call for the skills explored in this talk.

d

Saby Company
Delebio, Italy

Junior

asasd

Expire

Remote
Junior

Featured Partners

Related Articles

View all articles
BB
Benedikt Bischof
Using Java 17 latest features in real world projects
Welcome to this issue of the WeAreDevelopers Live Talk series. This article recaps an interesting talk by Ron Veen who introduced the audience to some of the most interesting features that got added to the Java language.About the speaker:Ron is a hig...
Using Java 17 latest features in real world projects
CH
Chris Heilmann
WeAreDevelopers LIVE days are changing - get ready to take part
Starting with this week's Web Dev Day edition of WeAreDevelopers LIVE Days, we changed the the way we run these online conferences. The main differences are:Shorter talks (half an hour tops)More interaction in Q&AA tips and tricks "Did you know" sect...
WeAreDevelopers LIVE days are changing - get ready to take part
CH
Chris Heilmann
All the videos of Halfstack London 2024!
Last month was Halfstack London, a conference about the web, JavaScript and half a dozen other things. We were there to deliver a talk, but also to record all the sessions and we're happy to share them with you. It took a bit as we had to wait for th...
All the videos of Halfstack London 2024!

From learning to earning

Jobs that call for the skills explored in this talk.

Java Developer

Java Developer

virtual7 GmbH

Senior
JUnit
Mockito
Jenkins
TypeScript
Continuous Integration
Java Developer

Java Developer

virtual7 GmbH

Senior
JUnit
Mockito
Jenkins
TypeScript
Continuous Integration
Java Developer

Java Developer

virtual7 GmbH

Senior
JUnit
Mockito
Jenkins
TypeScript
Continuous Integration
Java Developer

Java Developer

virtual7 GmbH

Senior
JUnit
Mockito
Jenkins
TypeScript
Continuous Integration
Java Developer

Java Developer

virtual7 GmbH

Senior
JUnit
Mockito
Jenkins
TypeScript
Continuous Integration
Java Developer

Java Developer

virtual7 GmbH

Senior
JUnit
Mockito
Jenkins
TypeScript
Continuous Integration
Java Developer

Java Developer

virtual7 GmbH

Senior
JUnit
Mockito
Jenkins
TypeScript
Continuous Integration