Skip to content

core-cpp 0.4.1

Choose a tag to compare

@github-actions github-actions released this 25 Sep 20:33
· 70 commits to master since this release

Added

  • seal() on Strand and KeyedStrands: close the offer door, keep running what is queued
    and what comes back.
    close() drops the queue, so a teardown of "stop the handlers, drain,
    close" dropped whatever arrived between the drain and the close -- a task's finish, a
    coroutine's resumption -- and leaked its frame and whatever it was to settle (found by morph's
    switch review). After seal(), tryPost and trySubmit return false and leave the work with
    the caller, for KeyedStrands for every key, a key with no strand included. post and submit
    are still admitted until close(): submit is how a coroutine the strand already admitted
    comes back -- ResumeOn, resumeOn(key), an AsyncQueue push, close or stop -- and dropping it
    would free a detached chain without its finish. Queued work runs as usual, and no kept
    KeyedStrands strand is handed out or kept once sealed.
    • What a drain can see: idle() and waitIdle() then mean nothing queued and nothing
      running. A coroutine suspended off the strand -- on a socket, a timer, an AsyncQueue -- is
      invisible to both and may still come back, so a consumer counts its own in-flight work. The teardown that loses nothing is seal(), then that
      count and waitIdle() both done (on the single-threaded WebAssembly build, the base run until
      they are), then close(). post is new work too: a producer that posts must stop, or offer
      through tryPost, before waitIdle().
    • Idempotent; close() is unchanged. A patch-compatible addition.

Known issues

  • MSVC cl 19.51 /O2 leaks a coroutine's by-value parameters when its frame is destroyed at
    a suspension point with no statement after it
    (#54). Keep a statement after the
    last co_await in a coroutine that may be destroyed while suspended.

Full Changelog: v0.4.0...v0.4.1