- member hooks must be destroyed before execution_context
- otherwise an segementation fault is caused
- destruction of execution_context deallocates stack on which
the member variables of context are allocated
- context::terminated_is_linked() might be missleading because this
state is transient
- if the context is pushed to the terminated-queue,
context::terminated_is_linked() returns true, if the context is
removed from terminated-queue context::terminated_is_linked() returns
false
- new flag flag_terminated intoduced
- flag_terminated will be set in context::set_terminated_(), which will
be called for worker context' in the lambda
- context::join() adds active-context to wait-queue only
if joined context is not terminated
- we can not use terminated_is_linked() because the context
might already be removed from scheudler's termianted-queue
- if no fibers are ready to run suspend the thread and wait till
* signaled by scheduler::signal() for new fiber (ready to run)
* time_point of a sleeping fiber has reached
- detail:.scheduler was removed
- fiber_context has a static thread-local pointer to the active
fiber_context
- fiber_context has member to pointer of fiber_manager
- functions of fiber_manager are accessed only via fiber_context
- if fiber f is resumed, the fiber_manager of the current active fiber
f' is assigned to f
-> that is necessary if f was stolen form another thread
When the running thread's main fiber calls this_fiber::properties<>() without
yet having passed through sched_algorithm_with_properties::awakened(), which
is what actually instantiates the fiber_properties subclass, you could end up
without a properties instance. Fortunately there's an easy workaround: call
yield().
Remove that workaround from examples/priority.cpp.