An example Scheduler using Fibers.
Thread with ThreadInfo, This is implemented to avoid using global variables.
Thrown on calls to receiveOnly if a message other than the type the receiving thread expected is sent.
Thrown when a Tid is missing, e.g. when ownerTid doesn't find an owner thread.
Receives a message from another thread.
Receives only messages with arguments of types T.
Tries to receive but will give up if no matches arrive within duration. Won't wait at all if provided core.time.Duration is negative.
Places the values as a message at the back of tid's message queue.
Starts fn(args) in a new logical thread.
Ditto, but do not assert in case of failure
Encapsulates all implementation-level data needed for scheduling.
An opaque type used to represent a logical thread.
<a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
Copyright Sean Kelly 2009 - 2014.
This is a low-level messaging API upon which more structured or restrictive APIs may be built. The general idea is that every messageable entity is represented by a common handle type called a Tid, which allows messages to be sent to logical threads that are executing in both the current process and in external processes using the same interface. This is an important aspect of scalability because it allows the components of a program to be spread across available resources with few to no changes to the actual implementation.
A logical thread is an execution context that has its own stack and which runs asynchronously to other logical threads. These may be preemptively scheduled kernel threads, fibers (cooperative user-space threads), or some other concept with similar behavior.
The type of concurrency used when logical threads are created is determined by the Scheduler selected at initialization time. The default behavior is currently to create a new kernel thread per call to spawn, but other schedulers are available that multiplex fibers across the main thread or use some combination of the two approaches.
Note: Copied (almost verbatim) from Phobos at commit 3bfccf4f1 (2019-11-27) Changes are this notice, and the module rename, from std.concurrency to geod24.concurrency.