virtual-threads
4 tutorials tagged “virtual-threads”.
- Platform Threads vs Virtual ThreadsCompare platform and virtual threads: cost, scheduling, memory and best uses, then handle 10,000 simulated requests with each and measure the difference.
- Socket Programming in JavaBuild TCP clients and servers with Socket and ServerSocket: streams, timeouts, common errors, and an echo server that handles many clients at once.
- Virtual Thread Best PracticesUse virtual threads well: never pool them, limit scarce resources with a Semaphore, avoid pinning, watch ThreadLocal, and keep CPU work on platform threads.
- Virtual Threads in JavaVirtual threads (Java 21) are lightweight threads managed by the JVM, so a program can run millions of them. Learn how to create them and how they work.