IT lexicon › Programming › Virtual thread

Virtual thread

Programming På svenska → Updated: 2026-11-16

A lightweight I/O thread (JEP 444) that runs atop a pool of OS threads, enabling millions of concurrent tasks.

Virtual threads are the Java embodiment of green threads. When a virtual thread blocks on I/O, the runtime automatically suspends it and runs another on the same OS thread—no developer annotation needed. This was formalized in Java 21 as Project Loom. Write straightforward synchronous code (blocking reads, loops, mutexes) but get the throughput of async/await in other languages. The runtime handles all the jumping around; you think in terms of one thread per request.

← Back to the lexicon