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

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 4

  • @Tony-dp1rl
    @Tony-dp1rl 11 месяцев назад +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 10 месяцев назад +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 7 месяцев назад

      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.

    • @lufenmartofilia5804
      @lufenmartofilia5804 3 месяца назад

      I prefere the virtual threads personnally. But you could go with something like kotlin if you don't like it