Java 21: Virtual Threads - A different async/await explained with Code Examples

Publié le: 18 septembre 2023
sur la chaîne: Th30z Code
8,894
299

Java 21 introduces lightweight concurrency with Virtual Threads.

Virtual threads are a different approach to asynchronous programming. Instead of having to rewrite everything using async/await keywords. Java will take care of everything.

Discover the changes introduced with JDK 21 and learn how Virtual Threads behaves with code examples demonstrating I/O Bound Tasks, CPU Bound Tasks, and Cooperative CPU Bound Tasks. Learn how the synchronized keyword and locks work in the context of Virtual Threads.

Code Examples available here:
https://gist.github.com/matteobertozz...
https://gist.github.com/matteobertozz...
Slides available here: https://speakerdeck.com/matteobertozz...

Chapters:
0:00 Java 21 - Project Loom
0:32 Platform Threads
1:41 Virtual Threads
2:38 Carrier Threads
3:49 Code Examples
3:53 I/O Bound Tasks (Virtual Threads Example)
4:42 CPU Bound Tasks (Virtual Threads Example)
5:31 Cooperative CPU Bound Tasks (Virtual Threads Example)
6:08 The synchronized Keyword (Virtual Threads Example)
6:41 Locks (Virtual Threads Example)
7:09 Should I switch to Virtual Threads?

#java #javaprogramming #backend #backenddeveloper


Sur cette page du site, vous pouvez voir la vidéo en ligne Java 21: Virtual Threads - A different async/await explained with Code Examples durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Th30z Code 18 septembre 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 8,894 fois et il a aimé 299 téléspectateurs. Bon visionnage!