Basic example to demonstrate the working of Platform and Virtual Threads.
More details around threads can be found here
- JDK 21
- You can use any compatible IDE or CLI to compile and execute the program
- NonVirtualThreadDemo uses Platform Thread to demonstrate the blocking nature of Thread execution
- VirtualThreadDemo uses Virtual Thread to demonstrate the mounting and unmounting of Threads
Program is ran by setting MAX_THREADS
to 10000
within the code and enabling Profile on Application Startup through JVM config.