-
Enhancement
-
Resolution: Fixed
-
P4
-
17
-
b10
Loading classes from parallelCapable() class loaders, like our AppClassLoader, don't need to take out LOAD_INSTANCE placeholders. They are not used for mutual exclusion for class loading and are essentially ignored. They are used for mutual exclusion for the bootstrap class loader and for user level Java class loaders that are not parallelCapable().
parallelCapable() class loaders take out a per-class lock in Java in the loadClass() method.
In SystemDictionary::load_instance_class_or_null, the only code that checks and waits for the LOAD_INSTANCE placeholder is in this conditional:
if (class_loader.is_null() || !is_parallelCapable(class_loader)) {
PlaceholderEntry* oldprobe = placeholders()->get_entry(name_hash, name, loader_data);
...
// case 3: traditional: should never see load_in_progress.
while (!class_has_been_loaded && oldprobe != NULL && oldprobe->instance_load_in_progress()) { <=== HERE
both bootloader (class_loader == NULL) and non-parallelCapable class loader wait on the SystemDictionary_lock
where non-parallelCapable loader first releases the class_loader instance lock
}
Loading classes with parallelCapable class loaders creates the LOAD_INSTANCE placeholder but ignores it.
parallelCapable() class loaders take out a per-class lock in Java in the loadClass() method.
In SystemDictionary::load_instance_class_or_null, the only code that checks and waits for the LOAD_INSTANCE placeholder is in this conditional:
if (class_loader.is_null() || !is_parallelCapable(class_loader)) {
PlaceholderEntry* oldprobe = placeholders()->get_entry(name_hash, name, loader_data);
...
// case 3: traditional: should never see load_in_progress.
while (!class_has_been_loaded && oldprobe != NULL && oldprobe->instance_load_in_progress()) { <=== HERE
both bootloader (class_loader == NULL) and non-parallelCapable class loader wait on the SystemDictionary_lock
where non-parallelCapable loader first releases the class_loader instance lock
}
Loading classes with parallelCapable class loaders creates the LOAD_INSTANCE placeholder but ignores it.