YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
yaclib::detail::fiber Namespace Reference

Classes

struct  Allocation
 
class  Atomic
 
class  Atomic< U * >
 
class  AtomicBase
 
class  AtomicFlag
 
class  AtomicFloatingBase
 
class  AtomicFloatingBase< T, true >
 
class  AtomicIntegralBase
 
class  AtomicIntegralBase< T, true >
 
class  AtomicWait
 
class  BiList
 
class  BiNodeScheduler
 
class  BiNodeWaitQueue
 
class  ConditionVariable
 
class  DefaultAllocator
 Allocator used by default. More...
 
class  ExecutionContext
 
class  Fiber
 
class  FiberBase
 
class  FiberQueue
 
class  IStackAllocator
 Passed to coroutine/fiber constructor, specifies the way in which memory for Stack is Allocated and Released. More...
 
class  Mutex
 
struct  Node
 
struct  NoTimeoutTag
 
class  RecursiveMutex
 
class  RecursiveTimedMutex
 
class  SharedMutex
 
class  SharedTimedMutex
 
class  Stack
 Manages stack memory. More...
 
struct  SystemClock
 
class  Thread
 
class  ThreadLocalPtrProxy
 
class  TimedMutex
 

Typedefs

using Trampoline = void(*)(void *arg)
 
template<typename... Args>
using FuncState = std::tuple< typename std::decay_t< Args >... >
 

Enumerations

enum  FiberState { Running , Suspended , Waiting , Completed }
 

Functions

void SetRandomListPick (std::uint32_t k) noexcept
 
NodePollRandomElementFromList (BiList &list)
 
voidGetImpl (std::uint64_t i)
 
void Set (void *new_value, std::uint64_t i)
 
void SetDefault (void *new_value, std::uint64_t i)
 
template<typename T , typename U >
bool operator== (const ThreadLocalPtrProxy< T > &lhs, const ThreadLocalPtrProxy< U > &rhs) noexcept
 
template<typename T , typename U >
bool operator!= (const ThreadLocalPtrProxy< T > &lhs, const ThreadLocalPtrProxy< U > &rhs) noexcept
 
template<typename T , typename U >
bool operator== (const ThreadLocalPtrProxy< T > &lhs, U *rhs) noexcept
 
template<typename T , typename U >
bool operator!= (const ThreadLocalPtrProxy< T > &lhs, U *rhs) noexcept
 
template<typename T , typename U >
bool operator== (T *lhs, const ThreadLocalPtrProxy< U > &rhs) noexcept
 
template<typename T , typename U >
bool operator!= (T *lhs, const ThreadLocalPtrProxy< U > &rhs) noexcept
 
template<typename T >
bool operator== (const ThreadLocalPtrProxy< T > &lhs, std::nullptr_t) noexcept
 
template<typename T >
bool operator== (std::nullptr_t, const ThreadLocalPtrProxy< T > &rhs) noexcept
 
template<typename T >
bool operator!= (const ThreadLocalPtrProxy< T > &lhs, std::nullptr_t) noexcept
 
template<typename T >
bool operator!= (std::nullptr_t, const ThreadLocalPtrProxy< T > &rhs) noexcept
 
template<typename T , typename U >
bool operator< (const ThreadLocalPtrProxy< T > &lhs, const ThreadLocalPtrProxy< U > &rhs) noexcept
 
template<typename T , typename U >
bool operator> (const ThreadLocalPtrProxy< T > &lhs, const ThreadLocalPtrProxy< U > &rhs) noexcept
 
template<typename T , typename U >
bool operator< (const ThreadLocalPtrProxy< T > &lhs, const U *rhs) noexcept
 
template<typename T , typename U >
bool operator< (T *lhs, const ThreadLocalPtrProxy< U > &rhs) noexcept
 
template<typename T , typename U >
bool operator> (const ThreadLocalPtrProxy< T > &lhs, const U *rhs) noexcept
 
template<typename T , typename U >
bool operator> (T *lhs, const ThreadLocalPtrProxy< U > &rhs) noexcept
 
template<typename T >
bool operator< (const ThreadLocalPtrProxy< T > &lhs, std::nullptr_t) noexcept
 
template<typename T >
bool operator< (std::nullptr_t, const ThreadLocalPtrProxy< T > &rhs) noexcept
 
template<typename T >
bool operator> (const ThreadLocalPtrProxy< T > &lhs, std::nullptr_t) noexcept
 
template<typename T >
bool operator> (std::nullptr_t, const ThreadLocalPtrProxy< T > &rhs) noexcept
 
template<typename T , typename U >
bool operator>= (const ThreadLocalPtrProxy< T > &lhs, const ThreadLocalPtrProxy< U > &rhs) noexcept
 
template<typename T , typename U >
bool operator<= (const ThreadLocalPtrProxy< T > &lhs, const ThreadLocalPtrProxy< U > &rhs) noexcept
 
template<typename T , typename U >
bool operator<= (const ThreadLocalPtrProxy< T > &lhs, const U *rhs) noexcept
 
template<typename T , typename U >
bool operator<= (T *lhs, const ThreadLocalPtrProxy< U > &rhs) noexcept
 
template<typename T , typename U >
bool operator>= (const ThreadLocalPtrProxy< T > &lhs, const U *rhs) noexcept
 
template<typename T , typename U >
bool operator>= (T *lhs, const ThreadLocalPtrProxy< U > &rhs) noexcept
 
template<typename T >
bool operator<= (const ThreadLocalPtrProxy< T > &lhs, std::nullptr_t) noexcept
 
template<typename T >
bool operator<= (std::nullptr_t, const ThreadLocalPtrProxy< T > &rhs) noexcept
 
template<typename T >
bool operator>= (const ThreadLocalPtrProxy< T > &lhs, std::nullptr_t) noexcept
 
template<typename T >
bool operator>= (std::nullptr_t, const ThreadLocalPtrProxy< T > &rhs) noexcept
 
void ScheduleFiber (FiberBase *fiber)
 
static autoGetMap ()
 

Variables

static FiberBase::Id sNextId = 1
 
static DefaultAllocator sAllocator
 
static std::uint32_t sRandomListPick = 10
 
static unsigned int gHardwareConcurrency {0}
 

Typedef Documentation

◆ FuncState

template<typename... Args>
using yaclib::detail::fiber::FuncState = typedef std::tuple<typename std::decay_t<Args>...>

Definition at line 10 of file fiber.hpp.

◆ Trampoline

Enumeration Type Documentation

◆ FiberState

Enumerator
Running 
Suspended 
Waiting 
Completed 

Definition at line 20 of file fiber_base.hpp.

Function Documentation

◆ GetImpl()

◆ GetMap()

static auto & yaclib::detail::fiber::GetMap ( )
static

Definition at line 9 of file thread_local_proxy.cpp.

References yaclib::MakeContract().

Referenced by GetImpl(), and SetDefault().

◆ operator!=() [1/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator!= ( const ThreadLocalPtrProxy< T > &  lhs,
const ThreadLocalPtrProxy< U > &  rhs 
)
inlinenoexcept

Definition at line 98 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator!=() [2/5]

template<typename T >
bool yaclib::detail::fiber::operator!= ( const ThreadLocalPtrProxy< T > &  lhs,
std::nullptr_t   
)
inlinenoexcept

Definition at line 133 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator!=() [3/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator!= ( const ThreadLocalPtrProxy< T > &  lhs,
U rhs 
)
inlinenoexcept

Definition at line 108 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator!=() [4/5]

template<typename T >
bool yaclib::detail::fiber::operator!= ( std::nullptr_t  ,
const ThreadLocalPtrProxy< T > &  rhs 
)
inlinenoexcept

Definition at line 138 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator!=() [5/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator!= ( T *  lhs,
const ThreadLocalPtrProxy< U > &  rhs 
)
inlinenoexcept

Definition at line 118 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator<() [1/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator< ( const ThreadLocalPtrProxy< T > &  lhs,
const ThreadLocalPtrProxy< U > &  rhs 
)
inlinenoexcept

Definition at line 143 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator<() [2/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator< ( const ThreadLocalPtrProxy< T > &  lhs,
const U rhs 
)
inlinenoexcept

Definition at line 153 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator<() [3/5]

template<typename T >
bool yaclib::detail::fiber::operator< ( const ThreadLocalPtrProxy< T > &  lhs,
std::nullptr_t   
)
inlinenoexcept

Definition at line 173 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator<() [4/5]

template<typename T >
bool yaclib::detail::fiber::operator< ( std::nullptr_t  ,
const ThreadLocalPtrProxy< T > &  rhs 
)
inlinenoexcept

Definition at line 178 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator<() [5/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator< ( T *  lhs,
const ThreadLocalPtrProxy< U > &  rhs 
)
inlinenoexcept

Definition at line 158 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator<=() [1/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator<= ( const ThreadLocalPtrProxy< T > &  lhs,
const ThreadLocalPtrProxy< U > &  rhs 
)
inlinenoexcept

Definition at line 198 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator<=() [2/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator<= ( const ThreadLocalPtrProxy< T > &  lhs,
const U rhs 
)
inlinenoexcept

Definition at line 203 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator<=() [3/5]

template<typename T >
bool yaclib::detail::fiber::operator<= ( const ThreadLocalPtrProxy< T > &  lhs,
std::nullptr_t   
)
inlinenoexcept

Definition at line 223 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator<=() [4/5]

template<typename T >
bool yaclib::detail::fiber::operator<= ( std::nullptr_t  ,
const ThreadLocalPtrProxy< T > &  rhs 
)
inlinenoexcept

Definition at line 228 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator<=() [5/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator<= ( T *  lhs,
const ThreadLocalPtrProxy< U > &  rhs 
)
inlinenoexcept

Definition at line 208 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator==() [1/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator== ( const ThreadLocalPtrProxy< T > &  lhs,
const ThreadLocalPtrProxy< U > &  rhs 
)
inlinenoexcept

Definition at line 93 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator==() [2/5]

template<typename T >
bool yaclib::detail::fiber::operator== ( const ThreadLocalPtrProxy< T > &  lhs,
std::nullptr_t   
)
inlinenoexcept

Definition at line 123 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator==() [3/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator== ( const ThreadLocalPtrProxy< T > &  lhs,
U rhs 
)
inlinenoexcept

Definition at line 103 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator==() [4/5]

template<typename T >
bool yaclib::detail::fiber::operator== ( std::nullptr_t  ,
const ThreadLocalPtrProxy< T > &  rhs 
)
inlinenoexcept

Definition at line 128 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator==() [5/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator== ( T *  lhs,
const ThreadLocalPtrProxy< U > &  rhs 
)
inlinenoexcept

Definition at line 113 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator>() [1/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator> ( const ThreadLocalPtrProxy< T > &  lhs,
const ThreadLocalPtrProxy< U > &  rhs 
)
inlinenoexcept

Definition at line 148 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator>() [2/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator> ( const ThreadLocalPtrProxy< T > &  lhs,
const U rhs 
)
inlinenoexcept

Definition at line 163 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator>() [3/5]

template<typename T >
bool yaclib::detail::fiber::operator> ( const ThreadLocalPtrProxy< T > &  lhs,
std::nullptr_t   
)
inlinenoexcept

Definition at line 183 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator>() [4/5]

template<typename T >
bool yaclib::detail::fiber::operator> ( std::nullptr_t  ,
const ThreadLocalPtrProxy< T > &  rhs 
)
inlinenoexcept

Definition at line 188 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator>() [5/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator> ( T *  lhs,
const ThreadLocalPtrProxy< U > &  rhs 
)
inlinenoexcept

Definition at line 168 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator>=() [1/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator>= ( const ThreadLocalPtrProxy< T > &  lhs,
const ThreadLocalPtrProxy< U > &  rhs 
)
inlinenoexcept

Definition at line 193 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator>=() [2/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator>= ( const ThreadLocalPtrProxy< T > &  lhs,
const U rhs 
)
inlinenoexcept

Definition at line 213 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator>=() [3/5]

template<typename T >
bool yaclib::detail::fiber::operator>= ( const ThreadLocalPtrProxy< T > &  lhs,
std::nullptr_t   
)
inlinenoexcept

Definition at line 233 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator>=() [4/5]

template<typename T >
bool yaclib::detail::fiber::operator>= ( std::nullptr_t  ,
const ThreadLocalPtrProxy< T > &  rhs 
)
inlinenoexcept

Definition at line 238 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ operator>=() [5/5]

template<typename T , typename U >
bool yaclib::detail::fiber::operator>= ( T *  lhs,
const ThreadLocalPtrProxy< U > &  rhs 
)
inlinenoexcept

Definition at line 218 of file thread_local_proxy.hpp.

References yaclib::MakeContract().

◆ PollRandomElementFromList()

Node * yaclib::detail::fiber::PollRandomElementFromList ( BiList list)

◆ ScheduleFiber()

void yaclib::detail::fiber::ScheduleFiber ( FiberBase fiber)

◆ Set()

void yaclib::detail::fiber::Set ( void new_value,
std::uint64_t  i 
)

◆ SetDefault()

◆ SetRandomListPick()

void yaclib::detail::fiber::SetRandomListPick ( std::uint32_t  k)
noexcept

Definition at line 143 of file scheduler.cpp.

References yaclib::MakeContract(), and sRandomListPick.

Referenced by yaclib::fiber::SetFaultRandomListPick().

Variable Documentation

◆ gHardwareConcurrency

unsigned int yaclib::detail::fiber::gHardwareConcurrency {0}
static

◆ sAllocator

DefaultAllocator yaclib::detail::fiber::sAllocator
static

Definition at line 10 of file fiber_base.cpp.

Referenced by yaclib::detail::fiber::FiberBase::GetAllocator().

◆ sNextId

FiberBase::Id yaclib::detail::fiber::sNextId = 1
static

Definition at line 8 of file fiber_base.cpp.

◆ sRandomListPick

std::uint32_t yaclib::detail::fiber::sRandomListPick = 10
static

Definition at line 141 of file scheduler.cpp.

Referenced by PollRandomElementFromList(), and SetRandomListPick().