Release Note: Virtual threads now unmount from carrier when waiting for another thread to execute a class initializer

XMLWordPrintable

      A virtual thread that waits for another thread to execute a class initializer will now, in most cases, unmount from its carrier while waiting. Previously, the behavior was to pin the virtual thread to its carrier while waiting for the other thread to execute the class initializer.

      This change may improve performance in some cases, as unmounting from the carrier releases a platform thread, allowing the JDK virtual thread scheduler to mount a different virtual thread.

      The change also helps address the pathological case where all platform threads available to the JDK virtual thread scheduler are pinned by virtual threads waiting for another thread to execute a class initializer. If the thread executing the class initializer blocks or waits on something that requires a virtual thread to execute, the system could become deadlocked, as no virtual thread would be able to continue execution.

            Assignee:
            Unassigned
            Reporter:
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: