YACLib
C++ library for concurrent tasks execution
|
Inspired mainly by https://gitlab.com/Lipovsky/twist (mostly we rewrote it to achieve our goals), and also:
YACLIB_FAULT=OFF
:
Just using for ::std
primitives
YACLIB_FAULT=THREAD
:
Thin wrappers for ::std
primitives with fault injection calls (sleep_for, yield etc.) in some of the methods
So it should be able to work in any environment, for example you cannot replace all primitives for yaclib_std::
YACLIB_FAULT=FIBER
:
Single thread cooperative, deterministic execution, trying to be ::std
compatible.
Using fiber instead of std::thread
and cooperative primitives for it with our own fiber scheduler.
You can just grep for header names <thread>
, <atomic>
etc. and replace them with<yaclib_std/thread>
, <yaclib_std/atomic>
. Similarly you can replace names from the standard library, e.g. std::thread
, std::atomic
etc. and replace them with YACLib equivalents yaclib_std::thread
, yaclib_std::atomic
, ....
And everything will just work.
FIBER
backend adopted to easily run with any test framework, check our test main::std
compatible, except std::future
/etc, because we suggest YACLib as drop-in alternative