© Ron Veen and David Vlijmincx 2024
R. Veen, D. VlijmincxVirtual Threads, Structured Concurrency, and Scoped ValuesApress Pocket Guideshttps://doi.org/10.1007/979-8-8688-0500-4_1

1. Virtual Threads

Ron Veen1   and David Vlijmincx2
(1)
ENSCHEDE, The Netherlands
(2)
HELMOND, The Netherlands
 

Virtual threads are one of the biggest new features of Java 21 since Lambdas. They have a big impact on how we implement concurrent code. As you probably know, you can have millions of them at the same time, something that wasn’t possible before with the virtual threads we had since Java 1.0. Before we dive deeper into what virtual threads are, it is good to know how threads we currently use work and what their limitations are.

To follow along with the examples in this ...

Get Virtual Threads, Structured Concurrency, and Scoped Values: Explore Java’s New Threading Model now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.