RFR(S) 8231125 Improve testing of parallel loading of shared classes by the boot class loader

coleen.phillimore at oracle.com coleen.phillimore at oracle.com
Tue Sep 17 21:24:59 UTC 2019



http://cr.openjdk.java.net/~iklam/jdk14/8231125-shared-boot-class-parallel-test.v01/src/hotspot/share/classfile/systemDictionary.cpp.udiff.html

Can you add a line something like.

+ if (class_loader() == NULL) {
+ // See case 3 in SystemDictionary::resolve_instance_class_or_null
+      // multiple threads wait on the SystemDictionary_lock if the boot loader class is in the placeholder table, so only
+      // one thread loads the class.
+ assert(ik->class_loader_data() == NULL, "boot loader classes are not 
loaded in parallel");
+ }
+

I wonder if the ObjectLocker is really needed for non-bootclass loaders 
below this code, since it appears to not be needed for boot class loaders.

The test changes look good.  I think you're supposed to have @bug tags 
in them.

Thanks for going through this code looking for races!
Coleen


On 9/17/19 1:10 PM, Ioi Lam wrote:
> https://bugs.openjdk.java.net/browse/JDK-8231125
> http://cr.openjdk.java.net/~iklam/jdk14/8231125-shared-boot-class-parallel-test.v01/ 
>
>
>
> [1] Modified ParallelLoadTest.java to also test the loading of shared 
> classes
>     into the boot loader.
> [2] Modified ParallelLoad.java to minimize the initial time lag when 
> the 4 parallel
>     threads compete to load the same class.
> [3] Added an assert in the JVM to verify that for a shared classes loaded
>     the boot class loader, SystemDictionary::load_shared_class is not 
> called
>     multiple times.
>



More information about the hotspot-runtime-dev mailing list