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>> ();
289 if (AllowInlining && SchedulerThread == Thread.CurrentThread && stackDepthQueueFiber < MaxStackDepth) {
446 private IEnumerator CancelWhenComplete (Fiber waitOnFiber, CancellationTokenSource cancelSource)
474 long frequencyTicks = (long)(updatesPerSecond * (float)TimeSpan.TicksPerSecond); // min time between updates (duration)
493 throw new ArgumentOutOfRangeException ("updatesPerSecond", "The updatesPerSecond must be >= 0");
540 if ((token.CanBeCanceled && token.IsCancellationRequested) || mainFiberCompleteCancelSource.IsCancellationRequested || disposeWaitHandle.WaitOne (0))
562 if ((token.CanBeCanceled && token.IsCancellationRequested) || mainFiberCompleteCancelSource.IsCancellationRequested || disposeWaitHandle.WaitOne (0))
594 if ((token.CanBeCanceled && token.IsCancellationRequested) || mainFiberCompleteCancelSource.IsCancellationRequested || disposeWaitHandle.WaitOne (0))
663 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:266
This class is the system default implementation of a FiberScheduler and is capable of scheduling and ...
Definition: SystemFiberScheduler.cs:46
void Run(Fiber fiber)
Run the blocking scheduler loop and perform the specified number of updates per second.
Definition: FiberScheduler.cs:206
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
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:454
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
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:472
WaitHandle SchedulerEventWaitHandle
Gets a wait handle which can be used to wait for a scheduler event to occur.
Definition: SystemFiberScheduler.cs:210
void Enqueue(T item)
Definition: ConcurrentQueue.cs:62
static CancellationToken None
Definition: CancellationToken.cs:52
Fiber(IEnumerator coroutine)
Initializes a new instance of the SpicyPixel.Threading.Fiber class.
Definition: Fiber.cs:323
WaitHandle WaitHandle
Definition: CancellationToken.cs:129
FiberInstruction ExecuteFiber(Fiber fiber)
Executes the fiber until it ends or yields.
Definition: FiberScheduler.cs:292
void Update(float time)
Update the scheduler which causes all queued tasks to run for a cycle.
Definition: SystemFiberScheduler.cs:350
Definition: IStructuralComparable.cs:33
SystemFiberScheduler()
Initializes a new instance of the SpicyPixel.Threading.FiberScheduler class.
Definition: SystemFiberScheduler.cs:251
Definition: Fiber.ContinueWith.cs:6
bool AllowInlining
Gets or sets a value indicating whether this SpicyPixel.Threading.FiberScheduler allows inlining.
Definition: FiberScheduler.cs:179
bool GetNextFiberWakeTime(out float fiberWakeTime)
Gets the time of the first fiber wake up.
Definition: SystemFiberScheduler.cs:424
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