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

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 มิ.ย. 2024
  • 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: gist.github.com/matteobertozz...
    Slides available here: 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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 8

  • @Phauglin99
    @Phauglin99 9 วันที่ผ่านมา +1

    Excellent explanation and visualization on an actual problem, not just printing "Hello World" lines. Thank you!

  • @manojBadam
    @manojBadam หลายเดือนก่อน

    Very good explanation

  • @yeshengwei79
    @yeshengwei79 8 หลายเดือนก่อน +3

    Very informative! Well done👍

    • @th30z-code
      @th30z-code  8 หลายเดือนก่อน +1

      Thanks! I'm glad you enjoyed it

  • @SuperShahidAkhtar
    @SuperShahidAkhtar 8 หลายเดือนก่อน +4

    Thanks for examples

    • @th30z-code
      @th30z-code  8 หลายเดือนก่อน +1

      Thanks for checking them out! I hope they were helpful.

  • @Anbu_Sampath
    @Anbu_Sampath 4 หลายเดือนก่อน +1

    Nice examples.

  • @Asingh42
    @Asingh42 6 หลายเดือนก่อน +2

    Now spring boot 3.2 supports virtual threads make a video on it how to use @Async with it