> We can forcefully preempt virtual threads at any safepoint poll point
What is a "safepoint poll point"? A sleep call?
> We can forcefully preempt virtual threads at any safepoint poll point
What is a "safepoint poll point"? A sleep call?
A safepoint poll points are points in a threads execution where it's able to go into a safepoint and transfer control to the JVM so it polls to see if it should.
https://openjdk.java.net/groups/hotspot/docs/HotSpotGlossary...
When bytecode is being interpreted, every bytecode instruction has a safepoint after it. In compiled code polls are scattered thoughout the code, for example on method entries and loop back edges (so the comment above about needing to add code in tight loops to help the GC is wrong).
This is something where the answer is "it depends". Hotspot will omit the safe point poll in counted loops since it knows those loops will terminate.