[crac] RFR: Fix ordering of invocation on Resources [v3]

Radim Vansa duke at openjdk.org
Wed Apr 26 15:22:23 UTC 2023


> * When Context.beforeCheckpoint throws, invoke Context.afterRestore anyway (otherwise some resources stay in suspended state).
> * Handle Resource.beforeCheckpoint triggering a registration of another resource ** Do not cause deadlock when registering from another thread ** Global resource can register JDKResource
> ** JDKResource can register resource with higher priority ** Other registrations are prohibited

Radim Vansa has updated the pull request incrementally with two additional commits since the last revision:

 - More fine-grained synchronization
 - Rework context ordering (round 2)
   
   * call afterRestore even if beforeCheckpoint throws
   * registering resource in previous/running context does not trigger exception immediatelly
   ** instead this will be one of the recorded exceptions and the resource has a chance to fire next time
   * we don't guarantee threads not deadlocking when trying to register a resource, though

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

Changes:
  - all: https://git.openjdk.org/crac/pull/60/files
  - new: https://git.openjdk.org/crac/pull/60/files/fb7d4ea7..1f2c7b39

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=crac&pr=60&range=02
 - incr: https://webrevs.openjdk.org/?repo=crac&pr=60&range=01-02

  Stats: 616 lines in 13 files changed: 338 ins; 161 del; 117 mod
  Patch: https://git.openjdk.org/crac/pull/60.diff
  Fetch: git fetch https://git.openjdk.org/crac.git pull/60/head:pull/60

PR: https://git.openjdk.org/crac/pull/60


More information about the crac-dev mailing list