Lines Matching refs:fiber
11 The fibers in a thread are coordinated by a fiber manager. Fibers trade
12 control cooperatively, rather than preemptively: the currently-running fiber
14 manager. Each time a fiber suspends (or yields), the fiber manager consults a
15 scheduler to determine which fiber will run next.
17 __boost_fiber__ provides the fiber manager, but the scheduler is a
26 calls: the fiber manager intercepts and defers such calls. Most
66 steal a ready fiber from another thread running this scheduler.
72 fiber scheduler must implement.
74 #include <boost/fiber/algo/algorithm.hpp>
101 [[Effects:] [Informs the scheduler that fiber `f` is ready to run. Fiber `f`
104 [[Note:] [This method advises the scheduler to add fiber `f` to its collection
115 [[Returns:] [the fiber which is to be resumed next, or `nullptr` if there is no
116 ready fiber.]]
117 [[Note:] [This is where the scheduler actually specifies the fiber which is to
136 [[Effects:] [Informs the scheduler that no fiber will be ready until
139 containing environment in whatever way makes sense. The fiber manager is
171 #include <boost/fiber/algo/round_robin.hpp>
196 [[Effects:] [Enqueues fiber `f` onto a ready queue.]]
205 [[Returns:] [the fiber at the head of the ready queue, or `nullptr` if the
227 [[Effects:] [Informs `round_robin` that no ready fiber will be available until
253 The victim scheduler (from which a ready fiber is stolen) is selected at random.
257 #include <boost/fiber/algo/work_stealing.hpp>
294 [[Note:][If `suspend` is set to `true`, then the scheduler suspends if no ready fiber could be stol…
295 The scheduler will by woken up if a sleeping fiber times out or it was notified from remote (other …
296 fiber scheduler).]]
304 [[Effects:] [Enqueues fiber `f` onto the shared ready queue.]]
313 [[Returns:] [the fiber at the head of the ready queue, or `nullptr` if the
335 [[Effects:] [Informs `work_stealing` that no ready fiber will be available until
367 #include <boost/fiber/algo/shared_work.hpp>
398 …][If `suspend` is set to `true` (default is `false`), then the scheduler suspends if no ready fiber
399 could be stolen. The scheduler will by woken up if a sleeping fiber times out or it was notified fr…
400 (other thread or fiber scheduler).]]
408 [[Effects:] [Enqueues fiber `f` onto the shared ready queue.]]
417 [[Returns:] [the fiber at the head of the ready queue, or `nullptr` if the
439 [[Effects:] [Informs `shared_work` that no ready fiber will be available until
465 for a fiber. For instance, a priority-based scheduler would need to track a
466 fiber[s] priority.
469 associate custom properties with each fiber.
473 A custom fiber properties class must be derived from `fiber_properties`.
475 #include <boost/fiber/properties.hpp>
516 fiber into some form of ready queue for `pick_next()`. In the latter case, if
517 application code modifies a fiber property (e.g. priority) that should affect
518 that fiber[s] relationship to other ready fibers, the custom scheduler must be
535 #include <boost/fiber/algorithm.hpp>
567 [[Effects:] [Informs the scheduler that fiber `f` is ready to run, like
568 [member_link algorithm..awakened]. Passes the fiber[s] associated `PROPS`
580 [[Returns:] [the fiber which is to be resumed next, or `nullptr` if there is no
581 ready fiber.]]
601 [[Effects:] [Informs the scheduler that no fiber will be ready until
621 [[Returns:] [the `PROPS` instance associated with fiber `f`.]]
623 [[Note:] [The fiber[s] associated `PROPS` instance is already passed to
638 property belonging to fiber `f`. `properties` contains the new values of
657 with fiber `f`.]]
680 #include <boost/fiber/context.hpp>
687 main_context = ``['unspecified]``, // fiber associated with thread's stack
688 dispatcher_context = ``['unspecified]``, // special fiber for maintenance operations
689 worker_context = ``['unspecified]``, // fiber not special to the library
690 pinned_context = ``['unspecified]`` // fiber must not be migrated to another thread
739 [[Returns:] [Pointer to instance of current fiber.]]
748 [[Returns:] [If `*this` refers to a fiber of execution, an instance of
749 __fiber_id__ that represents that fiber. Otherwise returns a
752 [[See also:] [[member_link fiber..get_id]]]
761 [[Effects:] [Attach fiber `f` to scheduler running `*this`.]]
765 [[Note:] [`f` must not be the running fiber[s] context. It must not be
784 [[Effects:] [Detach fiber `*this` from its scheduler running `*this`.]]
787 [[Note:] [This method must be called on the thread with which the fiber is
788 currently associated. `*this` must not be the running fiber[s] context. It
795 [[Note:] [In particular, it is erroneous to attempt to migrate a fiber from
798 the intended destination thread. `detach()` must be called on the fiber[s]
801 [[Note:] [Unless you intend make a fiber available for potential migration to
813 [[Note:] [`type::worker_context` here means any fiber not special to the
815 fiber of the thread: the one implicitly created by the thread itself, rather
817 the `context` is associated with a ["dispatching] fiber, responsible for
819 fiber is an implementation detail of the fiber manager. The context of the
820 ["main] or ["dispatching] fiber [mdash] any fiber for which
832 [[Note:] [The `context` has returned from its fiber-function and is
854 [[Returns:] [`true` if `*this` is stored in the fiber manager[s]
858 the fiber manager[s] remote-ready-queue. This is the mechanism by which the
859 fiber manager protects an [class_link algorithm] implementation from
871 [[Note:] [The `context` of a fiber waiting on a synchronization object (e.g.
949 [[Effects:] [Suspends the running fiber (the fiber associated with `*this`)
950 until some other fiber passes `this` to [member_link context..schedule].
952 another fiber to run.]]
966 [[Effects:] [Mark the fiber associated with context `*ctx` as being ready to
967 run. This does not immediately resume that fiber; rather it passes the fiber
977 fiber will be resumed on its original thread in due course.]]