3 ms·
So, that's a good point, and yes the scheduler will have an impact probably several orders of magnitude in comparison. That being said, a good scheduler is bas
by ioquatix 8y ago
So, that's a good point, and yes the scheduler will have an impact probably several orders of magnitude in comparison.
That being said, a good scheduler is basically just a loop, like:
https://github.com/kurocha/async/blob/bee8e8b95d23c6c0cfb31992491e4e9e1527db15/source/Async/Reactor.cpp#L63-L68 https://github.com/kurocha/async/blob/bee8e8b95d23c6c0cfb319...
So, once it's decided what work to do, it's just a matter of resuming all the fibers in order.
Additionally, since fibers know what work to do next in some cases, the overhead can be very small. You sometimes don't need to yield back to the scheduler, but can resume directly another task.