Struct Reactor
The main scheduler for the micro-threading architecture.
struct Reactor
;
Properties
Name | Type | Description |
---|---|---|
currentFiberHandle [get]
|
FiberHandle | Returns a FiberHandle to the currently running fiber |
currentFiberId [get]
|
mecca | Returns the FiberId of the currently running fiber. |
hangDetectorEnabled [get, set]
|
bool | Property for disabling/enabling the hang detector. |
isActive [get]
|
bool | Report whether the reactor is currently active |
isIdle [get]
|
bool | Returns whether currently running fiber is the idle fiber. |
isInCriticalSection [get]
|
bool | Reports whether execution is currently within a critical section |
isMain [get]
|
bool | Returns whether currently running fiber is the main fiber. |
isOpen [get]
|
bool | Report whether the reactor has been properly opened (i.e. - setup has been called). |
isRunning [get]
|
bool | Report whether the reactor is currently running |
isSpecialFiber [get]
|
bool | Returns whether currently running fiber is a special (i.e. - non-user) fiber |
reactorStats [get]
|
Reactor | Report the current reactor statistics. |
Methods
Name | Description |
---|---|
assertMayContextSwitch
|
Make sure we are allowed to context switch from this point. |
boostFiberPriority
|
Give a fiber temporary priority in execution. |
call
|
Schedule a callback for out of bounds immediate execution. |
considerYield
|
Perform yield if fiber is running long enough. |
criticalSection
|
Return a RAII object handling a critical section |
deferToThread
|
run a function inside a different thread. |
dontYield
|
Don't yield |
enterCriticalSection
|
enter a no-fiber switch piece of code. |
getFiberName
|
Retrieve the fiber name set by setFiberName
|
getFiberPtr
|
Retrieve the fiber pointer set by setFiberName
|
getFiberState
|
Returns the FiberState of the specified fiber.
|
iterateFibers
|
Iterate all fibers |
joinFiber
|
Wait until given fiber finishes |
leaveCriticalSection
|
leave the innermost critical section. |
LOG_TRACEBACK_AS
|
Log the stack trace of a given fiber. |
pushFiberName
|
Temporarily change the fiber's name |
registerIdleCallback
|
Register an idle handler callback. |
registerRecurringTimer
|
registers a timer that will repeatedly trigger at set intervals. |
registerTimer
|
Registers a timer task. |
registerTimer
|
Register a timer callback |
requestGCCollection
|
Request that a GC collection take place ASAP |
resumeFiber
|
Resume a suspended fiber |
setFiberName
|
Set a fiber name |
setup
|
Set the reactor up for doing work. |
shouldYield
|
Returns whether the fiber is already running for a long time. |
sleep
|
Suspend the current fiber for a specified amount of time |
spawnFiber
|
Spawn a new fiber for execution. |
spawnFiber
|
Spawn a new fiber for execution. |
start
|
Starts up the reactor. |
stop
|
Stop the reactor, killing all fibers. |
suspendCurrentFiber
|
Suspend the current fiber |
teardown
|
Shut the reactor down. |
throwInFiber
|
forward an exception to another fiber |
yield
|
Temporarily surrender the CPU for other fibers to run. |
Inner structs
Name | Description |
---|---|
OpenOptions
|
The options control aspects of the reactor's operation |
Stats
|
Used by reportStats to report statistics about the reactor
|
TimerHandle
|
Handle used to manage registered timers |
Aliases
Name | Description |
---|---|
IdleCallbackDlg
|
Delegates passed to registerIdleCallback must be of this signature
|