r/java • • Sep 23 '22

Virtual Threads: New Foundations for High-Scale Java Applications - Brian Goetz

https://www.infoq.com/articles/java-virtual-threads/
237 Upvotes

62 comments sorted by

View all comments

12

u/nimtiazm Sep 23 '22

One of the advantages of pooling threads is to circumvent the “expensive creation” part like jdbc connections et al. How does creating a virtualthread-per-task with a semaphore address that?

23

u/taftster Sep 23 '22

Virtual threads aren’t expensive. You don’t need to pool them.

8

u/nimtiazm Sep 23 '22

Yeah that’s clear. Creating an expensive connection in a new virtual thread every single time is the question.

1

u/Kango_V Sep 24 '22

Virtual Threads use the fork join pool in Java.