RFR: 8303674: JFR: TypeLibrary class not thread safe [v2]

Markus Grönlund mgronlun at openjdk.org
Fri Mar 10 17:07:06 UTC 2023


On Tue, 7 Mar 2023 20:50:56 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:

>> Could I have review of a PR that makes the TypeLibrary class thread safe. 
>> 
>> The problem occur when an application creates new AnnotationElement to use for dynamic events. The new types/classes need to be added to the type library, but the MetadataRepository lock can't be used for various reasons.
>> 
>> The biggest risk with this change is the introduction of a dead lock between the metadata lock and the type library lock. During testing I added a check to all synchronised methods in MetadataRepository to ensure lock ordering is never violated. 
>> 
>> A better solution may be a separate lock class that TypeLibrary and MetadataRepository could share, but it's a large change and not so suitable for a backport.
>> 
>> Testing: 100 * jdk/jdk/jfr
>> 
>> Thanks
>> Erik
>
> Erik Gahlin has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Change order of static and synchronized

Marked as reviewed by mgronlun (Reviewer).

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

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


More information about the hotspot-jfr-dev mailing list