The method can block for several seconds on acquiring the CodeCache_lock.
Since this is done without safepoint checks the thread is stuck with state _thread_in_vm for this period and any handshake or safepoint cannot continue. For safepoint this don't seem to bad, since the VM thread also tries to stop competing threads, but for a handshake, where a thread when finished it's handshake can continue to interfere will this lock, it's really bad.
The delay can be seem with e.g:
-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:HandshakeTimeout=5000 running RunThese30M
Yes that is 5 seconds timeout on the handshake.
Since this is done without safepoint checks the thread is stuck with state _thread_in_vm for this period and any handshake or safepoint cannot continue. For safepoint this don't seem to bad, since the VM thread also tries to stop competing threads, but for a handshake, where a thread when finished it's handshake can continue to interfere will this lock, it's really bad.
The delay can be seem with e.g:
-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:HandshakeTimeout=5000 running RunThese30M
Yes that is 5 seconds timeout on the handshake.