SystemFiberScheduler.cs
Go to the documentation of this file.
71 public static SystemFiberScheduler StartNew(CancellationToken token, float updatesPerSecond = 0f)
105 public static SystemFiberScheduler StartNew(Fiber fiber, CancellationToken token, float updatesPerSecond = 0f)
142 private ConcurrentQueue<Tuple<Fiber, float>> sleepingFibers = new ConcurrentQueue<Tuple<Fiber, float>>();
177 {
191 {
213 {
227 {
241 {
282 if(AllowInlining && SchedulerThread == Thread.CurrentThread && stackDepthQueueFiber < MaxStackDepth)
487 long frequencyTicks = (long)(updatesPerSecond * (float)TimeSpan.TicksPerSecond); // min time between updates (duration)
549 if((token.CanBeCanceled && token.IsCancellationRequested) || mainFiberCompleteCancelSource.IsCancellationRequested || disposeWaitHandle.WaitOne(0))
573 if((token.CanBeCanceled && token.IsCancellationRequested) || mainFiberCompleteCancelSource.IsCancellationRequested || disposeWaitHandle.WaitOne(0))
607 if((token.CanBeCanceled && token.IsCancellationRequested) || mainFiberCompleteCancelSource.IsCancellationRequested || disposeWaitHandle.WaitOne(0))
676 private void OnFiberInstruction(Fiber fiber, FiberInstruction instruction, out bool fiberQueued, out Fiber nextFiber)
Fiber StartNew(IEnumerator coroutine)
Start executing a new fiber using the default scheduler on the thread.
Definition: FiberFactory.StartNew.cs:19
sealed override void QueueFiber(Fiber fiber)
Queues the fiber for execution on the scheduler.
Definition: SystemFiberScheduler.cs:262
This class is the system default implementation of a FiberScheduler and is capable of scheduling and ...
Definition: SystemFiberScheduler.cs:46
Yield execution until the watched fiber on the same scheduler is complete.
Definition: YieldUntilComplete.cs:36
void Run(Fiber fiber)
Run the blocking scheduler loop and perform the specified number of updates per second.
Definition: FiberScheduler.cs:212
Definition: Tuple.cs:35
void Cancel()
Definition: CancellationTokenSource.cs:129
Definition: AggregateException.cs:31
A Fiber is a lightweight means of scheduling work that enables multiple units of processing to execut...
Definition: Fiber.ContinueWith.cs:8
Represents a fiber instruction to be processed by a FiberScheduler.
Definition: FiberInstruction.cs:43
sealed override void AbortRequested(Fiber fiber)
Invoked when an abort has been requested.
Definition: SystemFiberScheduler.cs:414
bool CanBeCanceled
Definition: CancellationToken.cs:117
bool TryDequeue(out T result)
Definition: ConcurrentQueue.cs:97
static SystemFiberScheduler StartNew(Fiber fiber, CancellationToken token, float updatesPerSecond=0f)
Starts a new thread, creates a scheduler, starts it running, and returns it to the calling thread...
Definition: SystemFiberScheduler.cs:105
bool IsCancellationRequested
Definition: CancellationToken.cs:123
void Start()
Start executing the fiber using the default scheduler on the thread.
Definition: Fiber.cs:443
Yield execution to a specific fiber belonging to the same scheduler as the current fiber...
Definition: YieldToFiber.cs:35
static FiberScheduler Current
Gets the default fiber scheduler for the thread.
Definition: FiberScheduler.cs:75
static SystemFiberScheduler StartNew(Fiber fiber)
Starts a new thread, creates a scheduler, starts it running, and returns it to the calling thread...
Definition: SystemFiberScheduler.cs:85
A FiberInstruction to pause execution of a fiber for the specified duration.
Definition: YieldForSeconds.cs:35
override void Run(Fiber fiber, CancellationToken token, float updatesPerSecond)
Run the blocking scheduler loop and perform the specified number of updates per second.
Definition: SystemFiberScheduler.cs:485
void Enqueue(T item)
Definition: ConcurrentQueue.cs:62
static CancellationToken None
Definition: CancellationToken.cs:52
WaitHandle WaitHandle
Definition: CancellationToken.cs:129
void Update(float time)
Update the scheduler which causes all queued tasks to run for a cycle.
Definition: SystemFiberScheduler.cs:348
Definition: IStructuralComparable.cs:33
SystemFiberScheduler()
Initializes a new instance of the SpicyPixel.Threading.FiberScheduler class.
Definition: SystemFiberScheduler.cs:248
Fiber ContinueWith(IEnumerator continuationCoroutine)
Creates a continuation that executes asynchronously when the target fiber completes.
Definition: Fiber.ContinueWith.cs:15
bool IsCompleted
Gets a value indicating whether this instance is completed.
Definition: Fiber.cs:204
bool GetNextFiberWakeTime(out float fiberWakeTime)
Gets the time of the first fiber wake up.
Definition: SystemFiberScheduler.cs:435
Definition: AotInterlocked.cs:3
static SystemFiberScheduler StartNew(CancellationToken token, float updatesPerSecond=0f)
Starts a new thread, creates a scheduler, starts it running, and returns it to the calling thread...
Definition: SystemFiberScheduler.cs:71
static SystemFiberScheduler StartNew()
Starts a new thread, creates a scheduler, starts it running, and returns it to the calling thread...
Definition: SystemFiberScheduler.cs:54