On Tue, 28 Oct 2025 16:57:43 GMT, Mat Carter <[email protected]> wrote:
>> src/hotspot/share/cds/aotMetaspace.cpp line 963:
>>
>>> 961: bool AOTMetaspace::is_recording_preimage_static_archive() {
>>> 962: if (CDSConfig::is_dumping_preimage_static_archive()) {
>>> 963: return _preimage_static_archive_dumped == 0;
>>
>> Do we need to use an acquiring load here? i.e. can the read here and the
>> cmpxchg below happen in different threads?
>> n.b. I'm not just thinking about the behaviour when this patch makes the
>> DCmd available but also what happens when we supplement it with the MXBean
>> interface to end recordings.
>
> I think it's okay, as ending the recording is controlled by the cmpxchg, even
> if two threads think the recording is still going on, only one call to end
> the recording will work, and if the threads both check whether the recording
> has completed they will both see that it has (regardless of which thread
> 'won')
Andrew I'm going to add the AtomicAccess::load_acquire, or would
AtomicAccess::load be enough
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2550719327