Voxxed Days Thessaloniki 2023 - Async Showdown: Java Virtual Threads vs. Kotlin Coroutines

Поділитися
Вставка
  • Опубліковано 2 гру 2023
  • Speaker : RICCARDO LIPPOLIS
    With so many options available for asynchronous programming on the JVM, it can be hard to keep up. Enter Java Virtual Threads, the new and upcoming feature in Java that promises to change the game. Lightweight, non-blocking, and more efficient than traditional threads, Java Virtual Threads are poised to become the go-to tool for efficient asynchronous programming. But what about Kotlin Coroutines, the popular alternative for asynchronous programming on the JVM? Will they become obsolete?
    In this talk, we'll dive deep into the new Java Virtual Threads feature and examine how they work. We'll also explore their potential impact on Kotlin Coroutines and the advantages and limitations of each approach. We'll show how they can be used together to create powerful and efficient asynchronous programming models.
    This talk is designed to be accessible to developers of all skill levels. Whether you're new to asynchronous programming or an experienced developer, you'll come away with a better understanding of the latest trends and how to apply them to your own projects.
    Join me for this exciting talk and witness the Async Showdown as we compare Java Virtual Threads and Kotlin Coroutines to determine the future of efficient asynchronous programming!
  • Наука та технологія

КОМЕНТАРІ • 3

  • @Tony-dp1rl
    @Tony-dp1rl 7 місяців тому +1

    Java really made a mess of Virtual Threads. What was needed was something like C#/.NET's TPL, with Tasks clever use of async/await, and dynamic hardware thread use built into the runtime via a hill climbing algorithm. Works so well, and is so simple to use.

    • @hoaphan-uc3me
      @hoaphan-uc3me 5 місяців тому +1

      It's interesting to hear perspectives on Java's Virtual Threads. While the comment suggests that there's a perceived mess in their implementation, it's worth noting that Java often evolves based on existing patterns and requirements. If you find comfort and efficiency in the familiarity of async/await and .NET's TPL, then that's a great approach to leverage.
      The analogy of comparing Java Virtual Threads to C#/.NET's TPL and async/await is akin to comparing a banh mi to a ham sandwich. Both have their unique flavors and are appreciated by different palates. If you have a preference for a particular approach, whether it's the simplicity of .NET's concurrency model or the intricacies of Java's Virtual Threads, it's all about choosing what suits your taste and aligns with your development goals.
      In the end, the beauty of programming lies in the diverse set of tools and languages available, allowing developers to select the ones that resonate with them and best address the challenges at hand. So, whether you enjoy a banh mi or a ham sandwich, the key is to savor the experience of crafting software with the tools that bring you the most satisfaction and efficiency.

    • @reinterpret_cast
      @reinterpret_cast 3 місяці тому

      Virtual threads are slightly higher level compared to C# async/await. They allow for cleaner syntax (you don't have to put async and await in every function) but give you less control of when to suspend execution (i.e. you can't do Task.Yield() in the middle of a long computation). IMHO for most of the relevant use cases this is a good trade-off.