Temporary VTMS transitions are used on the hot code paths in 3 VirtualThread class methods: unpark(), scheduleUnpark() and cancel(). In these cases we can't use the same approach as for normal VTMS transitions because it will add a bid overhead and impact scalability in a bad way.
An alternate approach is to use a lightweight way of hiding of temporary transitions from the JVM TI agents. However, there are a couple of areas with potential problems:
- suspending virtual/career threads which are in tmp transitions
- class load, class prepare and CFLH events in tmp transition code path
- VM operations and Handshakes on behalf of virtual threads in tmp transitions
- virtual threads in tmp VTMS transitions can disable normal VTMS transitions
Some thread identity problems are well covered in the JNI related bug:JDK-8292674
An alternate approach is to use a lightweight way of hiding of temporary transitions from the JVM TI agents. However, there are a couple of areas with potential problems:
- suspending virtual/career threads which are in tmp transitions
- class load, class prepare and CFLH events in tmp transition code path
- VM operations and Handshakes on behalf of virtual threads in tmp transitions
- virtual threads in tmp VTMS transitions can disable normal VTMS transitions
Some thread identity problems are well covered in the JNI related bug:
- relates to
-
JDK-8292674 ReportJNIFatalError should print all java frames
-
- Resolved
-