Skip to content

v1.5.0 - exception & correctness rewrites

Choose a tag to compare

@dankmeme01 dankmeme01 released this 14 Feb 01:26
· 82 commits to main since this release
  • Exceptions are no longer handled through the context, instead they are now stored in the promise/pollable
  • PollableBase poll function is now noexcept, and it must not throw, storing the exception until getOutput. This fixes exceptions escaping try/catch blocks
  • Pollable now may assume the poll function can throw and handles the exception, propagating in getOutput. Users should inherit NoexceptPollable and mark the poll function as noexcept for optimization if their pollables don't throw.
  • Exceptions in tasks no longer terminate the entire runtime, instead they close the task, print the error to the console and propagate the exception to a TaskHandle (if awaited or blockOn is called)
  • Awaiting a pollable no longer uses the vtable, and goes directly to the poll method, allowing better compiler optimization
  • All pollables that shouldn't throw have been marked as noexcept
  • Failed assertions no longer throw, but print the error and call abort()
  • Fix TaskHandle leaking the task by incorrectly detaching
  • Use asp::BoxedString for task/future/promise names to use less memory in the struct and enable cheap copying
  • Add arc::ready()
  • Add default void template argument to TaskHandle<> and BlockingTaskHandle<>
  • Fix IO driver stack overflow when going over 64 fds, raise fd limit to 128
  • Fix abandoned tasks potentially trying to re-schedule themselves, leading to use after frees during runtime teardown
  • Fix arc::joinAll not proprly working if the futures return void
  • Fix move assignment operator of Waker being incorrect and leading to task leaks
  • Fix oneshot channels not properly reporting channel closure (dropped sender)
  • Runtime::blockOn now accepts a function that returns a pollable
  • Make Waker intentionally nullable, add operator bool to eliminate need for optional<Waker>
  • Many virtuals in Task/Promise were removed for either performance reasons or because they are unnecessary
  • Some documentation was added to the docs/ subfolder
  • Visual Studio 2022 (MSVC 14.44 / 19.44) is supported again
  • A bunch of internal cleanups were done for ABI stability