geod24.concurrency

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.

Public Imports

std.variant
public import std.variant;
Undocumented in source.

Members

Aliases

SelectReturn
alias SelectReturn = Tuple!(bool, "success", int, "id")

Consists of the id and result of the select operation that was completed

Classes

Channel
class Channel(T)

A golang style channel implementation with buffered and unbuffered operation modes

FiberBlockedException
class FiberBlockedException
Undocumented in source.
FiberMutex
class FiberMutex

A Fiber level Mutex, essentially a binary FiberSemaphore

FiberScheduler
class FiberScheduler

An example Scheduler using Fibers.

FiberSemaphore
class FiberSemaphore

A Fiber level Semaphore

Functions

select
SelectReturn select(SelectEntry[] read_list, SelectEntry[] write_list, Duration timeout)

Block on multiple Channels

thisScheduler
FiberScheduler thisScheduler()

Get current running FiberScheduler

thisScheduler
void thisScheduler(FiberScheduler value)

Set current running FiberScheduler

Interfaces

Selectable
interface Selectable

A common interface for objects that can be used in select()

Structs

SelectEntry
struct SelectEntry

An aggregate to hold neccessary information for a select operation

SpinLock
struct SpinLock

A simple spinlock

Meta

License

<a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.

Authors

Sean Kelly, Alex Rønne Petersen, Martin Nowak