[crac] RFR: Update Reference Handling for CRaC [v3]

Anton Kozlov akozlov at openjdk.java.net
Mon Apr 25 17:59:57 UTC 2022


> This change updates Reference Handling after Alan's comments [1].
> * The new API is moved to the CRaC-related classes to avoid polluting or changing standard classes. This should make EA builds more attractive.
> * The method for waiting threads now accepts timeout, as turns to be needed by CleanerImpl.beforeCheckpoint().
> * Now reference handling outside of the JDK code is supported, see the supplied test update. The handing does not depend on the first-level reference processing thread's beforeCheckpoint is called first. After that, it was possible to remove the resource and the corresponding REFERENCE_HANDLER priority.
> 
> The methods for waiting threads cannot guarantee that a reference handling is complete for a particular queue and a set of threads, as nothing prevents an another concurrent thread to change the reachability of a random object that will end up in the queue after the method returns. The method is designed to synchronize reference handling and checkpoint. That is, to ensure that objects that are on the way to be enqueued are indeed enqueued and corresponding clean-up is performed, as demonstrated by the test.
> 
> [1] https://github.com/openjdk/crac/pull/13#issuecomment-1028024855

Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision:

  Make jdk.crac.Misc final

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

Changes:
  - all: https://git.openjdk.java.net/crac/pull/22/files
  - new: https://git.openjdk.java.net/crac/pull/22/files/5c4e03f6..24d2f2e4

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=crac&pr=22&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=crac&pr=22&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/crac/pull/22.diff
  Fetch: git fetch https://git.openjdk.java.net/crac pull/22/head:pull/22

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


More information about the crac-dev mailing list