View source code
Display the source code in core/thread/fiber.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Module core.thread.fiber

The fiber module provides OS-indepedent lightweight threads aka fibers.

Functions

NameDescription
fiber_switchContext(oldp, newp)
fiber_trampoline()

Classes

NameDescription
Fiber This class provides a cooperative concurrency mechanism integrated with the threading and garbage collection functionality. Calling a fiber may be considered a blocking operation that returns when the fiber yields (via Fiber.yield()). Execution occurs within the context of the calling thread so synchronization is not necessary to guarantee memory visibility so long as the same thread calls the fiber each time. Please note that there is no requirement that a fiber be bound to one specific thread. Rather, fibers may be freely passed between threads so long as they are not currently executing. Like threads, a new fiber thread may be created using either derivation or composition, as in the following example.

Authors

Sean Kelly, Walter Bright, Alex Rønne Petersen, Martin Nowak

License

Distributed under the Boost Software License 1.0. (See accompanying file LICENSE)