IT lexicon › Programming › Green thread

Green thread

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

A thread implemented by a language runtime in userspace, not by the OS, typically much lighter than OS threads.

Green threads are scheduled by the runtime, not the kernel. Creating millions of them is feasible; spawning millions of OS threads is not. The tradeoff: a blocking green thread blocks the entire OS thread underneath. Go goroutines, Lua coroutines, and Python's asyncio use this model. Java introduced "virtual threads" (Project Loom, 2023) to bring the same scalability within the JVM while keeping the familiar blocking-code style.

← Back to the lexicon