Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework reusability control in cancellable contination #2581

Merged
merged 6 commits into from
Mar 24, 2021

Commits on Mar 13, 2021

  1. Rework reusability control in cancellable contination

        * Update initCancellability documentation and implementation to be aligned with current invariants
        * Make parentHandle non-volatile and ensure there are no races around it
        * Establish new reusability invariants
          - Reusable continuation can be used _only_ if it's state is not REUSABLE_CLAIMED
          - If it is, spin-loop and wait for release
          - Now the parent is attached to reusable continuation only if it was suspended at least once. Otherwise, the state machine can return via fast-path and noone will be able to release intercepted continuation (-> detach from parent)
          - It implies that the parent is attached after trySuspend call and can be concurrently reused, this is where new invariant comes into play
    
    Fixes #2564
    qwwdfsad committed Mar 13, 2021
    Configuration menu
    Copy the full SHA
    9306f8c View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2021

  1. Simplify reusable continuations ever further

        * Leverage the fact that it's non-atomic and do not check it for cancellation prematurely. It increases the performance of fast-path, but potentially affects rare cancellation cases
        * Fix AwaitContinuation that has parentHandle == null but is not reusable
    qwwdfsad committed Mar 15, 2021
    Configuration menu
    Copy the full SHA
    8bc7bb6 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2021

  1. Configuration menu
    Copy the full SHA
    f9307e5 View commit details
    Browse the repository at this point in the history
  2. ~ Comment fixed

    elizarov committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    2f13e5c View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2021

  1. ~do not postpone cancellation for reusable continuations that do not …

    …belong to the current instance
    qwwdfsad committed Mar 23, 2021
    Configuration menu
    Copy the full SHA
    6e51bdb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    efd160e View commit details
    Browse the repository at this point in the history