Java / Java 21 Virtual Threads Interview questions
Explain the execution flow when a virtual thread makes a blocking call?
Consider a virtual thread issuing a network read. The sequence below shows how the JVM keeps the carrier thread productive instead of letting it sit idle.
The virtual thread never "knows" it was unmounted - its continuation resumes exactly where the blocking call left off, with the returned data available as if the call had simply blocked in place.
More Related questions...