2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-13 00:12:17 +00:00
Commit Graph

6 Commits

Author SHA1 Message Date
Oliver Kowalke
61dc492f31 some stuff/corrections 2015-06-19 18:55:02 +02:00
Oliver Kowalke
e22c7fb1cb some formating 2015-05-22 09:50:39 +02:00
Nat Goodspeed
dadc42a028 Add missing #include fiber_context.hpp. 2015-05-13 08:45:01 -04:00
Nat Goodspeed
95812f8321 Only notify() a sched_algorithm_with_properties if it is_ready().
While it's true that not every READY fiber is always in the scheduler's ready
queue -- there's a time window in which a READY fiber can be on the
fiber_manager's wait queue -- only READY fibers will ever be on the
scheduler's ready queue. So if (! fiber.is_ready()), there's no point in
bothering the sched_algorithm implementation with a change to its properties.
2014-11-19 10:25:31 -05:00
Nat Goodspeed
3595857849 property_change() method doesn't really belong in sched_algorithm.
sched_algorithm knows nothing about properties, so that class isn't really the
best place for the property_change() virtual method. Introduce intermediate
sched_algorithm_with_properties_base class, which introduces property_change_()
virtual method accepting fiber_properties*. Then the properties-specific
sched_algorithm_with_properties<PROPS> implementation calls property_change()
(no trailing underscore) with fiber_properties* cast to PROPS&. Thus the user-
coded sched_algorithm implementation can override property_change() and accept
PROPS& rather than the generic fiber_properties* pointer. But
fiber_properties::notify() -- which doesn't know its own PROPS subclass -- can
nonetheless call sched_algorithm_with_properties_base::property_change_().
2014-11-14 09:58:48 -05:00
Nat Goodspeed
ed64ee77f8 Set fiber_properties::sched_algo_ every time through awakened().
Instead of setting a fiber_properties subclass's sched_algo_ back pointer once
at construction time, unconditionally set it every time that fiber becomes
READY (and is therefore passed to sched_algorithm::awakened()). This handles
the case in which that fiber migrates to a different thread with a different
sched_algorithm subclass instance.

Break out fiber_properties::notify() implementation to a separate .cpp
implementation file so it can bring in algorithm.hpp. We don't want
properties.hpp to depend on algorithm.hpp.
2014-11-10 19:59:29 -05:00