RFR: 7903519 : jtreg/jtharness is missing features for basic crash testing [v4]
andrlos
duke at openjdk.org
Thu Dec 14 08:45:05 UTC 2023
On Thu, 14 Dec 2023 08:21:40 GMT, Vladimir Sitnikov <vsitnikov at openjdk.org> wrote:
>> would adding a `volatile` keyword to the atribute be sufficient? I am hesitant to make the tagged method synchronized as that would potentially create a bottleneck
>
> Please check https://shipilev.net/blog/2014/safe-public-construction/#_safe_publication
>
> The code reads `statusModifier` without synchronization, and it might observe uninitialized object. In other words, a `non-null` value does not mean it was fully initialized.
@vlsi it just occured to me that I can initialize the `statusModifier` during the initialization of the `Script` instance, therefore there should be no problem reading it from multiple threads.. WDYT? Sorry for throwing half witted ideas out here.. and I read the blog you shared I can see why you dont like the current approach and I agree it must be altered.
-------------
PR Review Comment: https://git.openjdk.org/jtharness/pull/57#discussion_r1426407222
More information about the jtharness-dev
mailing list