JDK-8304056 : Obsolete legacy parallel class loading workaround for non-parallel-capable class loaders
  • Type: CSR
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 21
  • Submitted: 2023-03-13
  • Updated: 2023-03-16
  • Resolved: 2023-03-16
Related Reports
CSR :  
Description
Summary
-------

Obsolete the option to enable the legacy parallel class loading workaround in HotSpot for non-parallel-capable class loaders, and remove the JVM implementation of the workaround.

Problem
-------

Prior to JDK 7, custom class loaders using non-hierarchical class delegation model were prone to deadlock (see [1] for details). A workaround was added in the VM in JDK 6 to allow parallel class loading for non-parallel-capable class loaders to avoid deadlocks. In addition, the VM also supports a common workaround at the time that some customers explicitly issue a wait() on the class loader lock.

Parallel-capable class loaders (CCC-4735126) are defined in Java SE 7 to support parallel class loading to implement a deadlock-free class loader using non-hierarchical class delegation model. [1] and [2] describe how to migrate those class loaders depending on this workaround to be multi-threaded parallel-capable class loaders. The workaround was intended to allow those customers to migrate to the new mechanism. It has been 11 years since JDK 7 and it's expected that those deadlock-prone custom class loaders should have migrated to the parallel-capable class loaders.

It is time to remove this workaround as it is an impediment to the project to eliminate the object monitors from pinning for virtual threads.

[1] https://openjdk.org/groups/core-libs/ClassLoaderProposal.html
[2] https://docs.oracle.com/javase/7/docs/technotes/guides/lang/cl-mt.html

Solution
--------

In JDK 20 an option -XX:+EnableWaitForParallelLoad was introduced be to enable this legacy workaround. This VM flag is obsolete and the legacy behavior is removed with this change.  The -XX:+EnableWaitForParallelLoad option will produce a warning and will be ignored otherwise.

Specification
-------------

    $ java -XX:+EnableWaitForParallelLoad -version
    Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option EnableWaitForParallelLoad; support was removed in 21.0
    java version "21-internal" 2023-09-19 LTS

Comments
Moving updated request to Approved.
16-03-2023

Yes, your understanding is correct. The deprecation CSR is linked. Thanks.
16-03-2023

[~coleenp], to check my understating, by obsoleting the option is accepted by the VM, but doesn't have any effect other than printing a warning. The text of the CSR is fine. You can use the usual mechanisms to refer to other issues, such as added a link to the deprecation CSR. HTH
16-03-2023

I changed the summary to "Obsolete and remove". Sorry for the cut/paste from the deprecation CSR but I thought it needed the background and the description was something we worked on together. Should I remove that too and point to the deprecation CSR?
16-03-2023

Moving to Provisional, not Approved. [~coleenp], please clarify if this CSR is for deprecation or the actual removal and re-Finalize.
15-03-2023

> It is time to deprecate and remove We already deprecated it 20, this is just for the removal..
13-03-2023