I have been playing around with the new virtual threads in java 19.
I created a simple webserver (java in-built hhtpserver not Jserver) and told it to use virtual threads for the handler.
Even in a UI app I can't get it to slow the main thread down.
It will happily use 10,000 threads and not a single warn or error, and the UI carries on as normal.
I did have to make some modifications to be able to use the preview features of Java 19 ( Erel I never touched the IDE at all - I respect your work ).
So far I am really impressed how they work - a simple test I ran 10,000 threads, each sleeping for 1 second, completed in 1.6 seconds.
Off to play some more ( the new features have gotten me coding again
)
I created a simple webserver (java in-built hhtpserver not Jserver) and told it to use virtual threads for the handler.
Even in a UI app I can't get it to slow the main thread down.
It will happily use 10,000 threads and not a single warn or error, and the UI carries on as normal.
I did have to make some modifications to be able to use the preview features of Java 19 ( Erel I never touched the IDE at all - I respect your work ).
So far I am really impressed how they work - a simple test I ran 10,000 threads, each sleeping for 1 second, completed in 1.6 seconds.
Off to play some more ( the new features have gotten me coding again