2014/1/16 Eugene Yakubovich
Why does it call spawn?
spawn() resumes the fiber
Shouldn't the scheduler (run method that follows) decide which fiber to run next? What happens if there's another fiber with a higher priority that's ready?
the scheduler does round-robin, priority is not used
A similar issue also comes up when launching a new fiber. The documentation supports the implementation in that the control immediately is transferred to the new fiber. However, shouldn't the scheduling algorithm decide when the new fiber should run?
if a fiber is constructed it should start immediately
As an unrelated issue, I think this maybe a bug -- it's setting the active fiber to ready instead of waiting:
yield() does suspend the current fiber and puts it at the end of the ready-queue, so the state of this fiber must be READY