RFR: 8372564: Convert StringDedup to use Atomic<T>

Axel Boldt-Christmas aboldtch at openjdk.org
Tue Dec 2 08:39:48 UTC 2025


On Thu, 27 Nov 2025 08:18:25 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> Please review this change to StringDedup to use Atomic rather than directly
> applying AtomicAccess to volatile members.
> 
> Testing: mach5 tier1-5

src/hotspot/share/gc/shared/stringdedup/stringDedupProcessor.hpp line 56:

> 54: 
> 55:   static OopStorage* _storages[2];
> 56:   static DeferredStatic<Atomic<StorageUse*>> _storage_for_requests;

What is the reason for the `DeferredStatic`?

Is it just for the init once semantics and asserts?

_Is this a style we should adapt more broadly for our init once static variables?_

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28524#discussion_r2580179792


More information about the hotspot-gc-dev mailing list