The Code StormYOUTUBE PLAYER LOADS ON PLAYJava virtual threads explained
Java

Java virtual threads explained: 100,000 threads in 2 seconds | Java Bolt of the Week

The Code Storm3 Dec 20262:38Open on YouTube

In this lesson

Your app calls a slow service 100,000 times and each call waits 1 second. With a pool of 200 normal threads that takes over 8 minutes. With Java 21 virtual threads it takes about 2 seconds. This video covers the whole topic in one go: what a virtual thread is, how to create one, why it scales, the Spring Boot switch, and the 3 rules to follow.

Facts used: virtual threads are final in Java 21 (JEP 444). Spring Boot 3.2+ on Java 21: spring.threads.virtual.enabled=true. Pinning inside synchronized is fixed in Java 24 (JEP 491). The 100,000-task demo ran in 1.75 s on JDK 21.

One Bolt, your Java Bolt of the Week: one Java or Spring Boot feature, explained simply.

Keep going

More Shorts.