Nebula
Loading...
Searching...
No Matches
Fibers::FiberQueue Class Reference

#include <fibers.h>

Classes

struct  Job
 

Public Types

typedef void(*) JobFunction(void *context)
 
typedef void(*) FiberFunction()
 

Public Member Functions

 FiberQueue ()
 constructor
 
virtual ~FiberQueue ()
 destructor
 

Static Public Member Functions

static void Setup (const FiberQueueCreateInfo &info)
 setup job queue
 
static void Discard ()
 discard job queue
 
template<class T >
static void Enqueue (JobFunction function, const Util::FixedArray< T * > &contexts, Threading::AtomicCounter *counter)
 enqueue job
 
static void Free (uint id)
 free a fiber
 
static void Sleep (FiberWaitContext context)
 sleep fiber
 
static bool WakeupFiber (Fibers::FiberContext &fiber)
 wake up sleeping fibers
 
static bool Dequeue (Fibers::FiberContext &fiber)
 dequeue job as a fiber
 

Static Private Attributes

static Threading::LockFreeQueue< JobPendingJobsQueue
 async queues
 
static Threading::LockFreeQueue< uintFiberIdQueue
 
static Util::FixedArray< Fibers::FiberFibers
 storage
 
static Util::FixedArray< FiberQueue::JobFiberContexts
 
static Util::FixedArray< Ptr< FiberThread > > Threads
 
static Threading::CriticalSection SleepLock
 sleeping fibers
 
static Util::Array< FiberWaitContextSleepingFibers
 

Member Typedef Documentation

◆ FiberFunction

void(*) Fibers::FiberQueue::FiberFunction()

◆ JobFunction

void(*) Fibers::FiberQueue::JobFunction(void *context)

Constructor & Destructor Documentation

◆ FiberQueue()

Fibers::FiberQueue::FiberQueue ( )

constructor

◆ ~FiberQueue()

Fibers::FiberQueue::~FiberQueue ( )
virtual

destructor

Member Function Documentation

◆ Dequeue()

bool Fibers::FiberQueue::Dequeue ( Fibers::FiberContext & fiber)
static

dequeue job as a fiber

◆ Discard()

void Fibers::FiberQueue::Discard ( )
static

discard job queue

◆ Enqueue()

template<class T >
void Fibers::FiberQueue::Enqueue ( JobFunction function,
const Util::FixedArray< T * > & contexts,
Threading::AtomicCounter * counter )
inlinestatic

enqueue job

◆ Free()

void Fibers::FiberQueue::Free ( uint id)
static

free a fiber

◆ Setup()

void Fibers::FiberQueue::Setup ( const FiberQueueCreateInfo & info)
static

setup job queue

◆ Sleep()

void Fibers::FiberQueue::Sleep ( FiberWaitContext context)
static

sleep fiber

◆ WakeupFiber()

bool Fibers::FiberQueue::WakeupFiber ( Fibers::FiberContext & fiber)
static

wake up sleeping fibers

Member Data Documentation

◆ FiberContexts

Util::FixedArray< FiberQueue::Job > Fibers::FiberQueue::FiberContexts
staticprivate

◆ FiberIdQueue

Threading::LockFreeQueue< uint > Fibers::FiberQueue::FiberIdQueue
staticprivate

◆ Fibers

Util::FixedArray< Fibers::Fiber > Fibers::FiberQueue::Fibers
staticprivate

storage

◆ PendingJobsQueue

Threading::LockFreeQueue< FiberQueue::Job > Fibers::FiberQueue::PendingJobsQueue
staticprivate

async queues

◆ SleepingFibers

Util::Array< FiberWaitContext > Fibers::FiberQueue::SleepingFibers
staticprivate

◆ SleepLock

Threading::CriticalSection Fibers::FiberQueue::SleepLock
staticprivate

sleeping fibers

◆ Threads

Util::FixedArray< Ptr< FiberThread > > Fibers::FiberQueue::Threads
staticprivate

The documentation for this class was generated from the following files: