Platform Threads, OS Threads, and Virtual Threads
In Java, every instance of java.lang.Thread is a platform thread that runs Java code on an underlying OS thread. The number of platform threads is limited to the number of OS threads, like in the above case study.A Virtual Thread is also an instance of java.lang.Thread, but it runs Java code on the same OS thread and shares it effectively, which makes the number of virtual threads can be much larger than the number of OS threads.Because the number of OS threads does not limit virtual threads, we can quickly increase the concurrent requests to achieve higher throughput.