Java / Java 21 Virtual Threads Interview questions
What is a platform thread?
A platform thread is the traditional Java thread that existed before virtual threads. Each platform thread wraps exactly one operating system thread in a 1:1 relationship.
It's scheduled by the OS, carries a relatively large default stack (around 1MB, though this is platform-dependent), and creating thousands of them can exhaust system memory and OS scheduling capacity.
You get one with the classic new Thread(...) constructor, or explicitly via Thread.ofPlatform().start(...) using the newer builder API.
More Related questions...