RFR: 8259067: bootclasspath append takes out object lock [v4]
Coleen Phillimore
coleenp at openjdk.java.net
Thu Jan 7 03:11:56 UTC 2021
On Thu, 7 Jan 2021 02:45:48 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Use acquire/release for first_append_entry_list
>
> Addition of release/acquire looks good. Note that we now update _first_append_entry with the same release semantics as ClassPathEntry::set_next - as we should in general.
>
> I'm not 100% clear on which part of these API's can only be called whilst the VM is still single-threaded, but ignoring that, the change to use locked updates with lock-free traversal seems functionally correct. The overall necessity of using locking does depend on the potential for concurrent calls to ClassLoader::add_to_boot_append_entries - something I have not investigated at all.
>
> Thanks,
> David
Thanks for reviewing this, David. The concurrent calls are from JVMTI where the lock was originally, but as suggested by Serguei, for safety, and to avoid tracing through all the callers, I moved the locking to the function where we write the list. It's not a performance critical operation.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1935
More information about the serviceability-dev
mailing list