Skip to content

Release v2.0.4

Choose a tag to compare

@dakka dakka released this 03 Jan 07:25
· 12 commits to main since this release

New implementation, now known as FIX8::fiber

This is a novel fiber implementation with a similar interface to std::thread. Taking any callable object, fibers cooperatively yield amongst themselves and the calling function within a single thread. Using fibers, single threaded applications can be written as though they were multi-threaded, with the advantage that no concurrency management is required. For multi-threaded applications, each thread maintains its own list of running fibers, leaving the user to implement their own concurrency controls. This implementation allows you to move fibers between threads. This can be used to share work or scale an application by adding more fibers to other or new threads.

  • x86_64 Linux only
  • single header-only
  • stackful fibers; stacksize configurable for each fiber
  • supports any callable object (eg. function, class member, lambda expression) with optional arguments
  • heap based, memory-mapped or placement stacks; user definable stack can also be used
  • context switch implemented with inline assembly
  • fibers can be moved to other threads (can be configured out for performance)
  • std::invoke style ctor, with arguments perfectly forwarded to the callable
  • extended API, supporting resume, resume_if, resume_with, kill, kill_all, suspend, schedule, join, join_if, detach, resume_main, schedule_if, move, suspend_if, wait_all and more
  • built-in fiber printer
  • optional built-in terminal based monitor
  • helper templates including async, make_fiber, launch_all and launch_all_with_params and more
  • supports fibers and this_fiber namespaces
  • ctor based fiber parameter struct (POD) - including fiber name, custom stack and stack size, launch policy, launch order and auto join
  • built-in round-robin scheduler
  • can be used with std::packaged_task, std::future, std::promise and so forth
  • fast, very lightweight
  • fiber exceptions and handling
  • built-in instrumentation (can be configured out for performance)
  • lots of examples
  • full API documentation
  • supports jfiber (similar to std::jthread)

Full Changelog: v2.0.1...v2.0.1