Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::FiberScheduler Struct Reference

Cooperative fiber scheduler with explicit workers and caller-owned storage. More...

#include <Fibers.h>

Public Member Functions

 FiberScheduler (const FiberScheduler &)=delete
 
FiberScheduler & operator= (const FiberScheduler &)=delete
 
Result enableRuntimeOwnedStacks ()
 
bool usesRuntimeOwnedStacks () const
 
Result checkExecutionThread () const
 
Result spawn (FiberTask &task, FiberStack &stack, FiberTask::Procedure procedure, FiberCounter *counter=nullptr)
 
Result spawn (FiberTask &task, FiberStack &stack, FiberTask::Procedure procedure, FiberCancellationToken token, FiberCounter *counter=nullptr)
 
Result spawn (FiberTask &task, FiberStack &stack, FiberTask::Procedure procedure, const FiberTaskSpawnOptions &options)
 
Result runOnce ()
 
Result runOnce (FiberWorker &worker)
 
Result runOnce (FiberWorker &worker, Span< FiberWorker > workerGroup)
 
Result runNoWait ()
 
Result runNoWait (FiberWorker &worker)
 
Result runNoWait (FiberWorker &worker, Span< FiberWorker > workerGroup)
 
Result runReadyFibers ()
 
Result runReadyFibers (FiberWorker &worker)
 
Result runReadyFibers (FiberWorker &worker, Span< FiberWorker > workerGroup)
 
Result run ()
 
Result run (FiberWorker &worker)
 
Result run (FiberWorker &worker, Span< FiberWorker > workerGroup)
 
Result createWorkerDeques (FiberAllocator &allocator, Span< FiberWorker > workers, size_t capacityPerWorker)
 
void releaseWorkerDeques (Span< FiberWorker > workers)
 
Result yield ()
 
Result shutdown ()
 
Result shutdown (FiberWorker &worker)
 
Result shutdown (FiberWorker &worker, Span< FiberWorker > workerGroup)
 
Result requestCancel (FiberTask &task)
 
Result requestCancel (FiberCancellationTokenSource &tokenSource)
 
Result requestCancelAll ()
 
void add (FiberCounter &counter)
 
Result done (FiberCounter &counter)
 
Result wait (FiberCounter &counter)
 
Result waitUninterruptible (FiberCounter &counter)
 
void setTraceHooks (const FiberTraceHooks &hooks)
 
void clearTraceHooks ()
 
FiberTask * currentTask ()
 
const FiberTask * currentTask () const
 
bool isCurrentTaskCancellationRequested () const
 
bool hasReadyFibers () const
 
bool hasActiveFibers () const
 
size_t readyFiberCount () const
 
size_t readyFiberCount (const FiberWorker &worker) const
 
size_t stolenFiberCount (const FiberWorker &worker) const
 
size_t stolenFiberCount (Span< FiberWorker > workers) const
 
size_t activeFiberCount () const
 
void schedulerDiagnostics (FiberSchedulerDiagnostics &diagnostics) const
 
void resetSchedulerDiagnostics ()
 
void workerDiagnostics (const FiberWorker &worker, FiberWorkerDiagnostics &diagnostics) const
 
void workerDiagnostics (Span< FiberWorker > workers, FiberWorkerDiagnostics &diagnostics) const
 
void resetWorkerDiagnostics (FiberWorker &worker)
 
void resetWorkerDiagnostics (Span< FiberWorker > workers)
 

Static Public Member Functions

static bool supportsRuntimeOwnedStacks ()
 Opt in before spawning. The scheduler remains bound to this thread and rejects worker pools.
 

Friends

struct FiberWorkerPool
 

Detailed Description

Cooperative fiber scheduler with explicit workers and caller-owned storage.

Member Function Documentation

◆ supportsRuntimeOwnedStacks()

static bool SC::FiberScheduler::supportsRuntimeOwnedStacks ( )
static

Opt in before spawning. The scheduler remains bound to this thread and rejects worker pools.


The documentation for this struct was generated from the following file: