Re:Java Virtual Threads: A Case Study
by giamma on Wednesday July 17, 2024 @08:22AM
(#40985073)
The JVM will need to do context switching when reallocating the real thread that is running a blocked virtual thread to the next available virtual thread. It won't be CPU context switching, but context switching happens at the JVM level and represents an effort.
[ Parent
| on HN ]
Re:Java Virtual Threads: A Case Study
by frant-hartm on Wednesday July 17, 2024 @09:10AM
(#40985500)
Ok. This JVM-level switching is called mounting/un-mounting of the virtual thread and is supposed to be several orders of magnitude cheaper compared to normal context switch. You should be fine with millions of virtual threads.