YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
config.cpp
Go to the documentation of this file.
1#include <fault/util.hpp>
2
5#if YACLIB_FAULT != 0
7#endif
8#if YACLIB_FAULT == 2
11#endif
12
13namespace yaclib {
14
15void SetFaultFrequency(std::uint32_t freq) noexcept {
17}
18
19void SetFaultSleepTime(std::uint32_t ns) noexcept {
21}
22
26
27void SetAtomicFailFrequency([[maybe_unused]] std::uint32_t k) noexcept {
28#if YACLIB_FAULT != 0
30#endif
31}
32
33void SetSeed(std::uint32_t seed) noexcept {
35}
36
37namespace fiber {
38
39void SetFaultTickLength([[maybe_unused]] std::uint32_t ns) noexcept {
40#if YACLIB_FAULT == 2
42#endif
43}
44
45void SetFaultRandomListPick([[maybe_unused]] std::uint32_t k) noexcept {
46#if YACLIB_FAULT == 2
48#endif
49}
50
51void SetStackSize([[maybe_unused]] std::uint32_t pages) noexcept {
52#if YACLIB_FAULT == 2
54#endif
55}
56
57void SetStackCacheSize([[maybe_unused]] std::uint32_t c) noexcept {
58#if YACLIB_FAULT == 2
60#endif
61}
62
63void SetHardwareConcurrency([[maybe_unused]] std::uint32_t c) noexcept {
64#if YACLIB_FAULT == 2
66#endif
67}
68
70 return detail::GetRandCount();
71}
72
76
77std::uint32_t GetInjectorState() noexcept {
78#if YACLIB_FAULT != 0
79 return GetInjector()->GetState();
80#else
81 return 0;
82#endif
83}
84
85void SetInjectorState([[maybe_unused]] std::uint32_t state) noexcept {
86#if YACLIB_FAULT != 0
88#endif
89}
90
91} // namespace fiber
92} // namespace yaclib
std::uint32_t GetState() const noexcept
Definition injector.cpp:57
void SetState(std::uint32_t state) noexcept
Definition injector.cpp:61
static void SetSleepTime(std::uint32_t ns) noexcept
Definition injector.cpp:45
static std::uint32_t GetSleepTime() noexcept
Definition injector.cpp:49
static void SetFrequency(std::uint32_t freq) noexcept
Definition injector.cpp:41
static void SetCacheSize(std::uint32_t size) noexcept
static IStackAllocator & GetAllocator() noexcept
virtual void SetMinStackSize(std::size_t bytes)=0
static void SetHardwareConcurrency(unsigned int hardware_concurrency) noexcept
Definition thread.cpp:85
static void SetTickLength(std::uint32_t tick) noexcept
void SetRandomListPick(std::uint32_t k) noexcept
void SetSeed(std::uint32_t new_seed)
Definition util.cpp:13
void SetAtomicWeakFailFrequency(std::uint32_t k)
Definition atomic.cpp:16
std::uint64_t GetRandCount()
Definition util.cpp:29
void ForwardToRandCount(std::uint64_t random_count)
Definition util.cpp:37
void ForwardToFaultRandomCount(std::uint64_t random_count) noexcept
Forwards random count for fiber-based execution to supplied one.
Definition config.cpp:73
std::uint32_t GetInjectorState() noexcept
Definition config.cpp:77
void SetFaultTickLength(std::uint32_t ns) noexcept
Sets the amount of time to be added to fiber's scheduler time after each schedule cycle.
Definition config.cpp:39
void SetHardwareConcurrency(std::uint32_t c) noexcept
Sets hardware_concurrency in fiber based execution.
Definition config.cpp:63
void SetStackCacheSize(std::uint32_t c) noexcept
Sets fiber stack cache size for fault injection.
Definition config.cpp:57
void SetFaultRandomListPick(std::uint32_t k) noexcept
Sets the length of scheduler queue prefix and suffix from which the next schedule candidate will be c...
Definition config.cpp:45
void SetInjectorState(std::uint32_t state) noexcept
Sets injector state to the supplied one.
Definition config.cpp:85
void SetStackSize(std::uint32_t pages) noexcept
Sets fiber stack size for fault injection in pages.
Definition config.cpp:51
std::uint64_t GetFaultRandomCount() noexcept
Definition config.cpp:69
detail::Injector * GetInjector() noexcept
Definition inject.cpp:6
void SetSeed(std::uint32_t seed) noexcept
Sets seed for random, which will be used when deciding when to yield, for fibers scheduler and random...
Definition config.cpp:33
void SetAtomicFailFrequency(std::uint32_t k) noexcept
Sets frequency with which compare_exchange_weak would fail.
Definition config.cpp:27
void SetFaultSleepTime(std::uint32_t ns) noexcept
Sets sleep time if sleep is used instead of yield for interrupting thread execution for fault injecti...
Definition config.cpp:19
void SetFaultFrequency(std::uint32_t freq) noexcept
Sets frequency with which fault will be injected.
Definition config.cpp:15
Contract< V, E > MakeContract()
Creates related future and promise.
Definition contract.hpp:25
std::uint32_t GetFaultSleepTime() noexcept
Definition config.cpp:23