[crac] RFR: Ensure empty Reference Handler and Cleaners queues [v2]

Anton Kozlov akozlov at openjdk.java.net
Tue Feb 1 08:55:42 UTC 2022


On Mon, 31 Jan 2022 12:51:22 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> At the time of checkpoint, a set of References may need handling. This change ensures no References pending in ReferenceHandler and in Cleaners.
>> 
>> System.gc() is a best effort attempt to make GC to look for References. Default VM flags (-DisableExplicitGC, -ExplicitGCInvokesConcurrent) should not block the call, but additional investigation is needed to make sure GC found all references.
>
> Anton Kozlov has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
> 
>   Ensure empty Reference Handler and Cleaners queues

Thanks for the look!

> I'm not sold on the extra `notifyAll` in ReferenceQueue::remove

At least it should be correct :) In the common case of a single thread handling a queue, notifyAll will be effectively no-op (no threads are waiting), so the overhead is small. If more than one thread is handling a queue, they could suffer from unnecessary wake-up.

I'll proceed with the integration, but will seek for the reivew on the core-libs-dev list.

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

PR: https://git.openjdk.java.net/crac/pull/13


More information about the crac-dev mailing list