RFR: 8324972: (bf) Make DirectByteBuffer.Deallocator idempotent [v4]

Mark Sheppard msheppar at openjdk.org
Thu Feb 15 11:59:06 UTC 2024


On Mon, 12 Feb 2024 09:48:15 GMT, Mark Sheppard <msheppar at openjdk.org> wrote:

>> Per Minborg has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Use existing UNSAFE static variable
>>  - Remove unused import
>
> Is the Deallocator abstraction designed to be thread safe as advocated in https://bugs.openjdk.org/browse/JDK-8316337  ?
> Is it  correct and proper design, hence good practice, as per the original logic, that Deallocator guard against improper release of its encapsulated native memory more than once?

> @msheppar Do you have any other information to add? I'm wondering if this issue should be closed as it seems to be passed on the assumption that the cleaning action runs more than once.

I've nothing to add other than to re-iterate if https://bugs.openjdk.org/browse/JDK-8316337 is made based on thread safety, then it needs to take into account the idempotent release of the underlying native memory as per the original logic. Otherwise base on your assertions the https://bugs.openjdk.org/browse/JDK-8316337 was not required

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

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


More information about the nio-dev mailing list