|
|
|
|
|
by brabel
694 days ago
|
|
> And there's no particular reason to believe the JVM can have a list of threads and their states more efficiently than the kernel can. Of course there is. The JVM is able to store the current stack for the Thread efficiently in the pre-allocated heap. Switching execution between Virtual Threads is very cheap. Experiments show you can have millions of VTs, but only a few thousand OS Threads. I don't know why you think preemption is a big downside?! The JVM only suspends a Thread at safe points and those are points where it knows exactly when to resume. I don't believe there's any downsides at all. |
|