YACLib
C++ library for concurrent tasks execution
|
Namespaces | |
namespace | fiber |
namespace | thread |
Typedefs | |
template<CoreType Type, typename V , typename E > | |
using | ResultCoreT = std::conditional_t< IsDetach(Type), NoResultCore, std::conditional_t< IsToShared(Type), SharedCore< V, E >, UniqueCore< V, E > > > |
template<bool SymmetricTransfer> | |
using | Transfer = InlineCore * |
template<typename V , typename E > | |
using | SharedCorePtr = IntrusivePtr< SharedCore< V, E > > |
template<typename V , typename E > | |
using | UniqueCorePtr = IntrusivePtr< UniqueCore< V, E > > |
template<bool Single> | |
using | AwaitOnCounterT = std::conditional_t< Single, OneCounter< NopeBase, NopeDeleter >, AtomicCounter< NopeBase, NopeDeleter > > |
template<typename V , typename E , bool Lazy, bool Shared> | |
using | PromiseTypeBase = std::conditional_t< Shared, AtomicCounter< SharedCore< V, E >, PromiseTypeDeleter< Lazy, Shared > >, OneCounter< UniqueCore< V, E >, PromiseTypeDeleter< Lazy, Shared > > > |
using | DefaultEvent = MutexEvent |
Enumerations | |
enum class | CoreType : unsigned char { None = 0 , Run = 1 << 0 , Detach = 1 << 1 , FromUnique = 1 << 2 , FromShared = 1 << 3 , ToUnique = 1 << 4 , ToShared = 1 << 5 , Call = 1 << 6 , Lazy = 1 << 7 } |
enum class | AsyncType { None , Unique , Shared } |
enum | WaitStatus { Timeout , Ready } |
enum class | LogLevel : unsigned char { Debug = 0 , Warn = 1 , Count = 3 } |
Variables | |
constexpr size_t | kSharedRefWithFuture = 4 |
constexpr size_t | kSharedRefNoFuture = 3 |
static std::uint32_t | sAtomicFailFrequency = 13 |
static std::uint32_t | sYieldFrequency = 16 |
static std::uint32_t | sSleepTime = 100 |
static std::uint64_t | sInjectedCount = 0 |
static std::uint32_t | sSeed = 1239 |
static thread_local std::mt19937_64 | eng {sSeed} |
static std::array< LogCallback, static_cast< std::size_t >(LogLevel::Count)> | sCallbacks = {} |
using yaclib::detail::AwaitOnCounterT = typedef std::conditional_t<Single, OneCounter<NopeBase, NopeDeleter>, AtomicCounter<NopeBase, NopeDeleter> > |
Definition at line 15 of file await_on_awaiter.hpp.
Definition at line 16 of file default_event.hpp.
using yaclib::detail::PromiseTypeBase = typedef std::conditional_t<Shared, AtomicCounter<SharedCore<V, E>, PromiseTypeDeleter<Lazy, Shared> >, OneCounter<UniqueCore<V, E>, PromiseTypeDeleter<Lazy, Shared> >> |
Definition at line 46 of file promise_type.hpp.
using yaclib::detail::ResultCoreT = typedef std::conditional_t<IsDetach(Type), NoResultCore, std::conditional_t<IsToShared(Type), SharedCore<V, E>, UniqueCore<V, E> >> |
Definition at line 49 of file shared_core.hpp.
using yaclib::detail::Transfer = typedef InlineCore* |
Definition at line 58 of file inline_core.hpp.
Definition at line 52 of file unique_core.hpp.
|
strong |
|
strong |
|
strong |
Enumerator | |
---|---|
Timeout | |
Ready |
Definition at line 5 of file wait_status.hpp.
|
constexpr |
Definition at line 12 of file condition_variable.cpp.
References yaclib::MakeContract().
|
constexpr |
Definition at line 5 of file condition_variable.cpp.
References yaclib::MakeContract(), and Ready.
Referenced by yaclib::detail::ConditionVariable< Impl >::wait_for(), and yaclib::detail::ConditionVariable< Impl >::wait_until().
void yaclib::detail::ForwardToRandCount | ( | std::uint64_t | random_count | ) |
Definition at line 37 of file util.cpp.
References GetRandNumber(), and yaclib::MakeContract().
Referenced by yaclib::fiber::ForwardToFaultRandomCount().
std::uint64_t yaclib::detail::GetRandCount | ( | ) |
Definition at line 29 of file util.cpp.
References yaclib::MakeContract().
Referenced by yaclib::fiber::GetFaultRandomCount().
std::uint64_t yaclib::detail::GetRandNumber | ( | std::uint64_t | max | ) |
Definition at line 22 of file util.cpp.
References eng, and yaclib::MakeContract().
Referenced by ForwardToRandCount(), yaclib::detail::Injector::MaybeInject(), yaclib::detail::fiber::PollRandomElementFromList(), ShouldFailAtomicWeak(), yaclib::fault::Scheduler::SleepPreemptive(), and yaclib::detail::fiber::SharedMutex::unlock().
std::uint32_t yaclib::detail::GetSeed | ( | ) |
Definition at line 18 of file util.cpp.
References sSeed.
Referenced by yaclib::detail::thread::RandomDevice::reset().
Definition at line 82 of file core.hpp.
References Call, and yaclib::MakeContract().
Definition at line 62 of file core.hpp.
References Detach, and yaclib::MakeContract().
Referenced by MakeCore(), and SetCallback().
Definition at line 70 of file core.hpp.
References FromShared, and yaclib::MakeContract().
Definition at line 66 of file core.hpp.
References FromUnique, and yaclib::MakeContract().
Definition at line 86 of file core.hpp.
References Lazy, and yaclib::MakeContract().
Referenced by SetCallback().
Definition at line 58 of file core.hpp.
References yaclib::MakeContract(), and Run.
Referenced by MakeCore().
Definition at line 74 of file core.hpp.
References yaclib::MakeContract(), and ToShared.
Referenced by MakeCore().
Definition at line 78 of file core.hpp.
References yaclib::MakeContract(), and ToUnique.
|
noexcept |
Definition at line 10 of file log.cpp.
References yaclib::MakeContract(), and sCallbacks.
|
noexcept |
Definition at line 46 of file inline_core.hpp.
References yaclib::detail::InlineCore::Here(), and yaclib::MakeContract().
Referenced by yaclib::detail::Destroy::await_suspend(), yaclib::detail::TransferAwaiter::await_suspend(), yaclib::detail::TransferSingleAwaiter< V, E >::await_suspend(), yaclib::detail::ReadyCore< V, E >::Call(), yaclib::Promise< V, E >::Set(), SetCallback(), yaclib::detail::BaseCore::SetResultImpl(), WhenSetResult(), yaclib::detail::AllCombinator< O, R, E >::~AllCombinator(), yaclib::detail::AllCombinator< OrderPolicy::Same, R, E >::~AllCombinator(), and yaclib::detail::AnyCombinatorBase< V, E, FailPolicy::FirstFail >::~AnyCombinatorBase().
Definition at line 363 of file core.hpp.
References IsDetach(), IsRun(), IsToShared(), kSharedRefWithFuture, yaclib::MakeContract(), None, Shared, and Unique.
|
noexcept |
Definition at line 27 of file drop_core.cpp.
References yaclib::MakeContract().
Referenced by yaclib::FutureBase< V, E >::Detach(), yaclib::Task< V, E >::Detach(), yaclib::Task< V, E >::Detach(), and SetCallback().
Definition at line 32 of file unique_job.hpp.
References yaclib::MakeContract().
Referenced by yaclib::Submit().
|
noexcept |
Definition at line 94 of file core.hpp.
References yaclib::MakeContract(), yaclib::detail::Node::next, and YACLIB_ASSERT.
Referenced by yaclib::detail::TransferAwaiter::await_suspend(), yaclib::detail::TransferSingleAwaiter< V, E >::await_suspend(), Start(), and Start().
|
noexcept |
Definition at line 35 of file inline_core.hpp.
References yaclib::MakeContract(), and yaclib_std::noop_coroutine().
Definition at line 54 of file core.hpp.
References yaclib::MakeContract().
Definition at line 50 of file core.hpp.
References yaclib::MakeContract().
YACLIB_INLINE auto yaclib::detail::Run | ( | IExecutor & | e, |
Func && | f | ||
) |
YACLIB_INLINE auto yaclib::detail::RunShared | ( | IExecutor & | e, |
Func && | f | ||
) |
Definition at line 32 of file run.hpp.
References Call, kSharedRefWithFuture, yaclib::MakeContract(), Run, and ToShared.
YACLIB_INLINE auto yaclib::detail::Schedule | ( | IExecutor & | e, |
Func && | f | ||
) |
Definition at line 9 of file schedule.hpp.
References Call, yaclib::MakeContract(), Run, and ToUnique.
void yaclib::detail::SetAtomicWeakFailFrequency | ( | std::uint32_t | k | ) |
Definition at line 16 of file atomic.cpp.
References yaclib::MakeContract(), and sAtomicFailFrequency.
Referenced by yaclib::SetAtomicFailFrequency().
auto yaclib::detail::SetCallback | ( | FromCorePtr && | core, |
IExecutor * | executor, | ||
Func && | f | ||
) |
Definition at line 389 of file core.hpp.
References FromShared, FromUnique, IsDetach(), IsLazy(), Loop(), yaclib::MakeContract(), MakeDrop(), yaclib::On(), Shared, Unique, and YACLIB_ASSERT.
|
noexcept |
Definition at line 17 of file log.cpp.
References yaclib::MakeContract(), and sCallbacks.
Definition at line 87 of file shared_event.hpp.
References yaclib::MakeContract(), and YACLIB_ASSERT.
Definition at line 63 of file shared_event.hpp.
References yaclib::MakeContract().
void yaclib::detail::SetSeed | ( | std::uint32_t | new_seed | ) |
Definition at line 13 of file util.cpp.
References eng, yaclib::MakeContract(), and sSeed.
Referenced by yaclib::SetSeed().
bool yaclib::detail::ShouldFailAtomicWeak | ( | ) |
Definition at line 11 of file atomic.cpp.
References GetRandNumber(), yaclib::MakeContract(), and sAtomicFailFrequency.
Referenced by yaclib::detail::AtomicBase< Impl, T >::compare_exchange_weak(), yaclib::detail::AtomicBase< Impl, T >::compare_exchange_weak(), yaclib::detail::AtomicBase< Impl, T >::compare_exchange_weak(), and yaclib::detail::AtomicBase< Impl, T >::compare_exchange_weak().
Definition at line 12 of file task_impl.cpp.
References yaclib::MakeContract(), and MoveToCaller().
Definition at line 6 of file task_impl.cpp.
References yaclib::MakeContract(), and MoveToCaller().
Referenced by yaclib::Task< V, E >::Detach(), yaclib::Task< V, E >::Detach(), yaclib::Task< V, E >::ToFuture(), and yaclib::Task< V, E >::ToFuture().
|
noexcept |
Definition at line 23 of file inline_core.hpp.
References yaclib::MakeContract().
|
constexprnoexcept |
Definition at line 318 of file core.hpp.
References yaclib::MakeContract().
Definition at line 65 of file wait_impl.hpp.
References Count, yaclib::MakeContract(), and WaitRange().
|
externnoexcept |
|
externnoexcept |
|
noexcept |
Definition at line 86 of file wait_impl.hpp.
References yaclib::MakeContract(), WaitRange(), and YACLIB_ASSERT.
|
noexcept |
Definition at line 20 of file wait_impl.hpp.
References yaclib::MakeContract().
Referenced by WaitCore(), and WaitIterator().
|
noexcept |
Definition at line 22 of file when_impl.hpp.
References yaclib::MakeContract(), and YACLIB_ASSERT.
|
noexcept |
Definition at line 13 of file when_impl.hpp.
References yaclib::MakeContract(), and YACLIB_ASSERT.
Referenced by yaclib::WhenAll(), yaclib::WhenAll(), yaclib::WhenAny(), and yaclib::WhenAny().
Definition at line 29 of file when_impl.hpp.
References Loop(), yaclib::MakeContract(), and yaclib::detail::UniqueHandle::SetResult().
|
static |
Definition at line 11 of file util.cpp.
Referenced by GetRandNumber(), and SetSeed().
|
inlineconstexpr |
Definition at line 10 of file shared_core.hpp.
Referenced by yaclib::MakeSharedPromise().
|
inlineconstexpr |
Definition at line 9 of file shared_core.hpp.
Referenced by MakeCore(), yaclib::MakeSharedContract(), yaclib::MakeSharedContractOn(), yaclib::detail::PromiseType< V, E, Lazy, Shared >::PromiseType(), and RunShared().
|
static |
Definition at line 9 of file atomic.cpp.
Referenced by SetAtomicWeakFailFrequency(), and ShouldFailAtomicWeak().
|
static |
Definition at line 8 of file log.cpp.
Referenced by LogMessage(), and SetCallback().
|
static |
Definition at line 11 of file injector.cpp.
Referenced by yaclib::detail::Injector::GetInjectedCount(), and yaclib::detail::Injector::MaybeInject().
|
static |
|
static |
Definition at line 10 of file injector.cpp.
Referenced by yaclib::detail::Injector::GetSleepTime(), yaclib::detail::Injector::MaybeInject(), and yaclib::detail::Injector::SetSleepTime().
|
static |
Definition at line 9 of file injector.cpp.
Referenced by yaclib::detail::Injector::SetFrequency().