RFR: 8316337: (bf) Concurrency issue in DirectByteBuffer.Deallocator [v3]

Brent Christian bchristi at openjdk.org
Mon Sep 18 19:11:44 UTC 2023


On Mon, 18 Sep 2023 16:44:02 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> If only one cleaner thread runs, can we just safely assume it is run only once and simply remove the `deallocated` check, which only defends against some, but not all, of those erroneous situations?
>
>> If only one cleaner thread runs, can we just safely assume it is run only once and simply remove the `deallocated` check, which only defends against some, but not all, of those erroneous situations?
> 
> Cleaner specifies that it is run once so yes, I think flag can be dropped, as well as checking if the address is 0.

`address` can't be 0 if asserts a enabled. Might `address` be 0 if asserts **_aren't_** enabled?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15784#discussion_r1329168242


More information about the nio-dev mailing list