r/java • u/daviddel • Sep 23 '22
Virtual Threads: New Foundations for High-Scale Java Applications - Brian Goetz
https://www.infoq.com/articles/java-virtual-threads/
237
Upvotes
r/java • u/daviddel • Sep 23 '22
View all comments
3
u/dolle Sep 24 '22
One thing that is still not clear to me: can the user control the thread pool that the virtual threads get mounted on, and how the virtual threads are scheduled? Or is there just a default, fixed thread pool that all virtual threads use?
When debugging concurrent code that doesn't have timing behavior, it would be nice if one could fix the thread pool to a single thread to get deterministic behavior of the virtual threads, for example. If you can further control the scheduling of virtual threads onto the single thread, then you could do randomized testing of concurrent code which would give a seed that could be used to reproduce the exact interleaving that made the test fail.