Closed Behemyth closed 6 years ago
With the work stealing implementation any fiber that is pushed onto the readyQueue can immediately be stolen. This is worked around by changing yielding the fiber as soon as it starts, guaranteeing the fiber properties are updated. This causes an extra awaken and pick_next call (relatively expensive)
When adding a task to the scheduler variables are added via the custom properties. Because the scheduler runs across multiple threads, the fibers are not guaranteed to modify their properties before being submitted. Therefore, when the are run, they change the properties, then yield, causing the values to update at the potential expense of two more context switches.
Check out the Boost/Fiber repository by olk