Quick revision
The short answer
Java chose user-mode threads because the thread is already Java's unit of concurrency everywhere: in its APIs, debuggers, profilers and exception stack traces. Making threads cheap lets existing blocking code and libraries scale without being rewritten, whereas async/await splits functions into two kinds that cannot be mixed freely, and that split spreads through a code base. The price was years of JDK work to make blocking operations unmount, plus a few remaining pinning cases. For an organisation, the implication is to prefer straightforward blocking code on Java 21 or later and to treat reactive frameworks as a tool for specific needs rather than the default.
What to remember
In this answer, we saw that Java chose user-mode threads because the thread is already its unit of concurrency in APIs, debuggers, profilers and stack traces, and making threads cheap lets existing blocking code and libraries scale without a rewrite. async/await instead splits functions into two kinds that do not mix freely, and the split spreads through code bases. The JDK paid for this with years of work to make blocking operations unmount, with a few pinning cases left. For an organisation, it means preferring plain blocking code on Java 21 or later and using reactive frameworks only where their specific features matter.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Java chose user-mode threads because the thread is already Java's unit of concurrency everywhere: in its APIs, debuggers, profilers and exception stack traces. Making threads cheap lets existing blocking code and libraries scale without being rewritten, whereas async/await splits functions into two kinds that cannot be mixed freely, and that split spreads through a code base. The price was years of JDK work to make blocking operations unmount, plus a few remaining pinning cases. For an organisation, the implication is to prefer straightforward blocking code on Java 21 or later and to treat reactive frameworks as a tool for specific needs rather than the default.
Background to this question
Language design decisions shape what code an organisation writes for decades. C#, JavaScript, Python, Rust and Kotlin all added some form of async functions, and for years many Java teams adopted reactive libraries to get the same benefits. Project Loom took a different road, and understanding why helps a senior engineer decide where to place long-term bets. In this answer, we will recap the problem both approaches solve, look at how async/await works and what it costs, see what Java did instead and what that cost the JDK, and then draw the practical conclusions for language and framework choices.
1A Quick Recap of the Problem
Servers spend most of their time waiting on I/O. With one operating system thread per request, a server runs out of threads long before it runs out of CPU, because OS threads are expensive: each one has a large stack and is scheduled by the kernel. To handle many concurrent waits, something must let a waiting task give up its thread and resume later.
There are two ways to do that. The language can transform functions so that they can pause at marked points and resume as callbacks, which is async/await. Or the runtime can make threads themselves cheap, by saving and restoring a waiting thread's stack in user space instead of keeping an OS thread blocked, which is what user-mode threads, virtual threads in Java, do.
2How async/await Works and What It Splits
With async/await, a function marked async is compiled into a state machine that returns a promise or task immediately. Inside it, await pauses the function until a result arrives, and the compiler rewrites the rest of the function as a continuation. The code reads almost sequentially, which is a big improvement over raw callbacks.
But there is a catch. Only async functions can await, and to call an async function without blocking, the caller must be async too. So asynchrony spreads upward through every caller, and libraries need two versions of many APIs, a synchronous one and an async one. This is often called the function colouring problem: functions come in two colours, and the colours do not mix freely. Stack traces and debuggers also need special support, because a paused function is a state object on the heap, not a frame on a thread's stack.
3What Java Did Instead
Java already had the thread as its central concept. Thread.currentThread(), ThreadLocal, synchronized, interrupts, exception stack traces, thread dumps, debuggers that step through a thread and profilers that sample threads all assume it. Instead of adding a second concept, Loom made the existing one cheap. A virtual thread is a java.lang.Thread whose stack lives in the heap while it waits; when it blocks on a socket, a lock or a sleep, the JVM unmounts it from its carrier thread and mounts another one.
| Aspect | async/await | Virtual threads |
|---|---|---|
| Where the work happens | Compiler rewrites functions | Runtime saves and restores stacks |
| Effect on APIs | Sync and async versions needed | Existing blocking APIs scale |
| Calling across styles | Async spreads to every caller | Any code can call any code |
| Stack traces and debuggers | Need special support | Normal thread tools work |
| Main cost | Paid by every code base | Paid once, inside the JDK |
Notice that load() is the same code we would have written in 2005. Every existing library that blocks through the JDK's I/O and locking APIs, such as JDBC drivers and HTTP clients, gains the scalability without a new API. There is only one colour of function.
4What It Cost the JDK
The approach moved the cost from every application to the JDK, and that cost was large. The JDK team spent years, from Loom's start around 2017 to the final feature in Java 21, reworking the parts of the platform that block: socket and file I/O, java.util.concurrent locks, sleep, and many internal paths, so that a blocked virtual thread unmounts instead of holding its carrier. Some cases remained. On Java 21 to 23, blocking while holding a monitor from synchronized pins the virtual thread to its carrier; JDK 24 removed that with JEP 491. Calls through native code and some file system operations still pin or temporarily compensate by adding carriers. These cases are now narrow, but they are why a newer JDK matters for virtual threads.
5What This Implies for Our Bets
For an organisation, the conclusion is fairly direct. On Java 21 or later, and preferably Java 25, the default for new services should be straightforward blocking code, such as Spring MVC with JDBC or JPA and RestClient, running on virtual threads. It is the style most developers know, it debugs and profiles well, and it uses the largest set of libraries. Reactive frameworks remain valuable where their particular features matter, such as backpressure-aware streaming, event processing and many long-lived connections, and they should be chosen for those reasons, not as a general way to scale.
It also means some past bets deserve review. Libraries that offer only reactive APIs, internal frameworks built around Mono and Flux, and guidelines that told teams to avoid blocking at all costs were reasonable answers to expensive threads. Now they are a cost that needs a justification. We should not rewrite working systems for this alone, but new work and major changes should follow the new default.
6Follow-up questions
Does this mean CompletableFuture is obsolete?
Not entirely. It is still useful for composing results that arrive at different times and for APIs that must return immediately. But for the common pattern of starting a few calls in parallel and waiting for all of them, starting virtual threads and blocking on their results, or structured concurrency once it is final, is simpler and keeps normal stack traces.
Why did Kotlin choose coroutines on the JVM then?
Kotlin needed a solution years before Loom existed and had to run on older JVMs and on other platforms such as JavaScript and native code. Coroutines with suspend functions gave it that, with the colouring trade-off. Kotlin code on a modern JVM can also use virtual threads, and teams can choose per use case.
Are there workloads where async/await is genuinely better?
In environments with a single thread, such as JavaScript in a browser, async functions fit naturally because there are no other threads to use. In languages without a managed runtime, such as Rust, the compiler-based approach avoids needing a runtime scheduler. On the JVM, where the runtime already manages threads, the user-mode thread approach fits better.
7Conclusion
In this answer, we saw that Java chose user-mode threads because the thread is already its unit of concurrency in APIs, debuggers, profilers and stack traces, and making threads cheap lets existing blocking code and libraries scale without a rewrite. async/await instead splits functions into two kinds that do not mix freely, and the split spreads through code bases. The JDK paid for this with years of work to make blocking operations unmount, with a few pinning cases left. For an organisation, it means preferring plain blocking code on Java 21 or later and using reactive frameworks only where their specific features matter.
Open with
Java's whole platform is built around the thread. APIs like ThreadLocal and interrupts, exception stack traces, thread dumps, debuggers and profilers all assume it. async/await adds a second concept: the compiler turns async functions into state machines, and only async code can await without blocking.
Then, if they want more
So asynchrony spreads up every call chain, libraries need sync and async versions of their APIs, and you get the function colouring problem, where two kinds of functions do not mix freely. Loom took the other route and made the existing concept cheap.
A virtual thread is a normal Thread whose stack is saved in the heap while it waits, so ordinary blocking code, and all the existing libraries that block through the JDK, scale to huge numbers of concurrent tasks without being rewritten, and the tools keep working.
The cost was paid inside the JDK: years of work to make sockets, locks and sleep unmount instead of block, and some pinning cases remain, like synchronized before JDK 24 and native calls.
For an organisation, my conclusion is that on Java 21 or later, ideally 25, plain blocking code on virtual threads should be the default for new services, because it is simpler to write, debug and hire for.
Reactive frameworks are still the right tool for streaming and backpressure, but they should be chosen for those reasons, not as the general way to scale.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Java 21, Java 24, Java 25
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- JEP 444, Virtual Threads
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Java chose user-mode threads (Project Loom) rather than async/await keywords as C# and...": https://scrivio-interview-library.netlify.app/java/virtual-threads/2166482b89/