On Mon, 24 Oct 2022 12:16:54 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:

> This change adds an option **EnableWaitForParallelLoad** to enable the legacy 
> behavior where the VM will manage synchronization for multiple threads 
> loading the same class using a non-parallel capable class loader that have 
> released the class loader lock.  The VM will break the class loader lock for 
> parallel threads trying to load the class, and wait for the first thread that 
> initiated loading the class to complete.  The subsequent threads will use the 
> result of the first thread, rather than get a LinkageError: duplicate class 
> definition for loading the class without synchronization.
> Releasing the class loader lock was a common workaround for class loaders 
> that used a non-hierarchical delegation scheme to avoid deadlock, before 
> parallel capable class loading was added. 
> https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ClassLoader.html#registerAsParallelCapable()
> 
> Tested with tier1-6 and internal applications.

This pull request has now been integrated.

Changeset: 76790ad2
Author:    Coleen Phillimore <cole...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/76790ad2427b777b470ef3e5474fa8df9f3bf875
Stats:     25 lines in 7 files changed: 14 ins; 1 del; 10 mod

8295673: Deprecate and disable legacy parallel class loading workaround for 
non-parallel-capable class loaders

Reviewed-by: mchung, dholmes

-------------

PR: https://git.openjdk.org/jdk/pull/10832

Reply via email to