Главная
Study mode:
on
1
Intro
2
Why Virtual Threads have been added?
3
Analyzing the CPU usage of your blocking code
4
Why the "one request per thread" model cannot work
5
Solving this problem: less expensive threads or asynchronous code?
6
Introducing the asynchronous solution
7
Writing an imperative, blocking online shopping example
8
Making this code asynchronous the CompletableFuture API
9
Issues with the asynchronous code: debugging, testing, stack trace, exception handling, timeout handling
10
Making threads less expensive: by how much?
11
Creating and using virtual threads
12
How Virtual Threads are working under the hood
13
Running blocking code in a virtual thread
14
Handling native code and synchronized blocks: avoid pinning virtual threads
15
Wrapping up: virtual threads are cheap, blocking them is fine
16
Outro
Description:
Explore Virtual Threads, a groundbreaking feature in JDK 21, in this 34-minute video tutorial. Discover how to implement and leverage Virtual Threads to address the complexities of asynchronous programming while maintaining high performance. Learn why traditional "one request per thread" models fall short and how Virtual Threads offer a solution. Follow along with practical examples, including an online shopping scenario, to understand the differences between blocking code, asynchronous programming with CompletableFuture API, and the simplicity of Virtual Threads. Gain insights into the inner workings of Virtual Threads, their creation and usage, and best practices for handling native code and synchronized blocks. By the end of this comprehensive guide, grasp why Virtual Threads are considered a game-changer in Java concurrency, offering the benefits of simple imperative blocking code without sacrificing throughput performance.

Java 21 New Feature - Virtual Threads

Java
Add to list
0:00 / 0:00