RFR: 8324972: Potential thread safety issue in DirectByteBuffer.Deallocator that could lead to unspecified runtime behaviour

Alan Bateman alanb at openjdk.org
Wed Jan 31 09:00:08 UTC 2024


On Wed, 31 Jan 2024 08:41:05 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> This PR proposes to make deallocators and unmappers for memory regions idempotent. This is to prevent (likely very rare) duplicate invocations. 
> 
> There are no unit tests but it should be noted that the idempotent behavior (now correct) is similar to the  intended behavior before cf74b8c2a32f33019a13ce80b6667da502cc6722 but where idempotency was not guaranteed in a multi-threaded environment.
> 
> Passes tier1, 2, and 3 tests.

I'm busy this week but I will reply to this PR next week. I don't object to making it idempotent but I have concerns with using AtomicBoolean and it pulling in MH/VH classes. It very important that we have as few dependences as possible in this area.

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

PR Comment: https://git.openjdk.org/jdk/pull/17647#issuecomment-1918661840


More information about the nio-dev mailing list