Urgent.News

What's breaking now, across thousands of outlets.

Tech

Java Virtual Threads vs Kotlin Coroutines: Suspension Models and the Shifting Bottleneck

The usage and internals of Java virtual threads and Kotlin coroutines are already widely covered. Rather than explaining each technology separately, this post compares how their different ways of implementing suspension change how code is written and operated. It is written for JVM server developers who have adopted or are evaluating virtual threads, and it focuses on where the costs that virtual…

Java virtual threads and Kotlin coroutines are two methods to handle suspension in JVM server development, both aiming to improve code readability and resource efficiency. However, they achieve this goal through different suspension models.

In Java virtual threads, suspension and resumption are managed by saving the stack and unmounting from the carrier, which is an OS thread. This allows the thread to return to the original OS thread without any marker in the code. For instance, in the provided code snippet, the `for` loop runs each task on its own virtual thread, which can efficiently handle operations like fetching data from a database without blocking the OS thread.

On the other hand, Kotlin coroutines handle suspension by calling the function again after saving local variables and the next label value in a Continuation object. This makes suspension points explicit in the source code, requiring the use of `suspend` and `launch` keywords. While coroutines also release the thread while waiting, the function has to be explicitly declared as `suspend`, and the suspension point is marked in the code.

In both cases, the key difference lies in how the suspended state is kept. Virtual threads keep it by saving the stack, while coroutines do it by returning from the function and calling it again later. Despite these differences, neither approach increases the total amount of resources; they merely shift the bottleneck to a less visible place. The resource bottleneck doesn't disappear, it just moves to a more hidden location.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Custom fields on the WooCommerce Checkout block: why your old snippet does nothing

If you added a checkout field with woocommerce_checkout_fields or printed one on woocommerce_after_order_notes , and it's simply not there on a newer store, the store is probably using the Checkout…

  • WooCommerce Checkout block introduced in 8.3
  • woocommercecheckoutfields only partially supported
  • Additional Checkout Fields API introduced in 8.9

Implementing 2026 Seller Compliance Practices for Retrying Failed Email API Calls

TL;DR: Retry a failed email API call only when the response is plausibly transient, use capped exponential backoff with jitter, and write an immutable attempt record before each sleep.

  • Implement capping mechanism for exponential backoff with jitter
  • Record attempt details for B2B marketplace orders
  • Distinguish between API acceptance and downstream delivery

Line-anchored output and the filter chips

JSLab feature notes: one docs page, explained. Today: The output panel . JSLab is a JavaScript & TypeScript scratchpad for macOS. You type, it runs, and the output panel fills up.

  • JSLab is a macOS development environment for JavaScript and TypeScript.
  • Output rows display line of code and corresponding results, logs, or errors.
  • Four filter chips categorize output entries and show live counts.

WireGuard on your own or Tailscale in a homelab: what control plane do you want to operate

In short: The short answer is that Tailscale is WireGuard with the coordination work done by someone else. The real question is not which one encrypts better, but which part of the control plane do…

  • Tailscale simplifies control with automatic network and NAT handling
  • WireGuard requires manual configuration and maintenance
  • Tailscale Personal plan is free for non-commercial use

More from Monday 2 November →