J.VI · Java 25 practice question

How does the Java 25 runtime schedule virtual threads onto physical processor cores?

Choose one answer
Check answer and explanation

Correct answer: The JDK's scheduler assigns virtual threads to platform threads, which the OS then schedules onto processor cores.

Explanation

Virtual threads use M:N scheduling: the JDK scheduler mounts virtual threads onto platform threads, and the OS schedules those platform threads on CPU cores as usual.

Common trap

Having the OS kernel schedule virtual threads directly is tempting because that is how platform threads work, but virtual threads are managed by the JDK's own scheduler. Bypassing the OS scheduler to assign virtual threads directly to CPU cores is tempting as a misunderstanding of user-mode scheduling, yet the JDK still relies on OS-scheduled platform threads.

Source: JEP 444: Virtual Threads — Description
Checked against the cited text on 2026-11-25.

Report an error in this question