FiberScheduler

An example Scheduler using `Fiber`s.

This is an example scheduler that creates a new Fiber per call to spawn and multiplexes the execution of all fibers within the main thread.

Members

Classes

InfoFiber
class InfoFiber

Fiber which embeds a ThreadInfo

Functions

create
void create(void delegate() op)

Creates a new Fiber which calls the given delegate.

newCondition
Condition newCondition(Mutex m)

Returns a Condition analog that yields when wait or notify is called.

spawn
void spawn(void delegate() op)

This created a new Fiber for the supplied op and adds it to the dispatch list.

start
void start(void delegate() op)

This creates a new Fiber for the supplied op and then starts the dispatcher.

yield
void yield()

If the caller is a scheduled Fiber, this yields execution to another scheduled Fiber.

Properties

thisInfo
ThreadInfo thisInfo [@property getter]

Returns an appropriate ThreadInfo instance.

Inherited Members

From Scheduler

start
void start(void delegate() op)

Spawns the supplied op and starts the Scheduler.

spawn
void spawn(void delegate() op)

Assigns a logical thread to execute the supplied op.

yield
void yield()

Yields execution to another logical thread.

thisInfo
ThreadInfo thisInfo [@property getter]

Returns an appropriate ThreadInfo instance.

newCondition
Condition newCondition(Mutex m)

Creates a Condition variable analog for signaling.

Meta