Java / Java 21 Virtual Threads Interview questions
Define a carrier thread?
A carrier thread is a platform thread that the JVM scheduler uses to actually execute a virtual thread's code. It "carries" the virtual thread while it is mounted.
Carrier threads come from a dedicated internal pool, sized by default to the number of available processor cores, and are shared across whichever virtual threads currently need to run.
When a mounted virtual thread performs a blocking operation the JVM knows how to handle asynchronously, it is unmounted and its carrier is freed to run a different virtual thread.
More Related questions...