RFR: 8335217: Fix memory ordering in ClassLoaderData::ChunkedHandleList

Stefan Karlsson stefank at openjdk.org
Thu Jun 27 09:34:08 UTC 2024


On Thu, 27 Jun 2024 02:25:57 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

> ClassLoaderData::ChunkedHandleList's head is installed via Atomic::release_store(). Therefore, readers need Atomic::Atomic::load_acquire() barrier to access its members safely.

Did you see that ChunkedHandleList::_size is also updated concurrently? If there's truly a concurrency order that this fixes, then maybe we should at least use Atomic::load when we're reading the _size?

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

PR Review: https://git.openjdk.org/jdk/pull/19919#pullrequestreview-2144814728


More information about the hotspot-runtime-dev mailing list