vibe.core.concurrency

Functions and structures for dealing with threads and concurrent access.

This module is modeled after std.concurrency, but provides a fiber-aware alternative to it. All blocking operations will yield the calling fiber instead of blocking it.

Public Imports

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

Members

Classes

VibedScheduler
class VibedScheduler
Undocumented in source.

Enums

ConcurrencyPrimitive
enum ConcurrencyPrimitive

Functions

assumeIsolated
Isolated!T assumeIsolated(T object)

Unsafe facility to assume that an existing reference is unique.

async
Future!(ReturnType!CALLABLE) async(CALLABLE callable, ARGS args)

Starts an asynchronous computation and returns a future for the result value.

asyncWork
Future!(ReturnType!CALLABLE) asyncWork(CALLABLE callable, ARGS args)
Undocumented in source. Be warned that the author may not have intended to support it.
lock
ScopedLock!T lock(shared(T) object)
void lock(shared(T) object, void delegate(scope T) nothrow accessor)
void lock(shared(T) object, void delegate(scope T) accessor)

Locks the given shared object and returns a ScopedLock for accessing any unshared members.

makeIsolated
Isolated!T makeIsolated(ARGS args)

Creates a new isolated object.

makeIsolatedArray
Isolated!(T[]) makeIsolatedArray(size_t size)

Creates a new isolated array.

prioritySend
void prioritySend(Task task, ARGS args)
Undocumented in source. Be warned that the author may not have intended to support it.
prioritySend
void prioritySend(Tid tid, ARGS args)
Undocumented in source. Be warned that the author may not have intended to support it.
send
void send(Task task, ARGS args)
Undocumented in source. Be warned that the author may not have intended to support it.
send
void send(Tid tid, ARGS args)
Undocumented in source. Be warned that the author may not have intended to support it.
setConcurrencyPrimitive
void setConcurrencyPrimitive(ConcurrencyPrimitive primitive)

Sets the concurrency primitive to use for śtd.concurrency.spawn().

Structs

Future
struct Future(T)

Represents a values that will be computed asynchronously.

ScopedLock
struct ScopedLock(T)

Proxy structure that keeps the monitor of the given object locked until it goes out of scope.

Templates

Isolated
template Isolated(T)

Encapsulates the given type in a way that guarantees memory isolation.

ScopedRef
template ScopedRef(T)

Encapsulates a reference in a way that disallows escaping it or any contained references.

haveTypeAlready
template haveTypeAlready(T, TYPES...)
Undocumented in source.
isCopyable
template isCopyable(T)
Undocumented in source.
isStronglyIsolated
template isStronglyIsolated(T...)

Determines if the given list of types has any non-immutable aliasing outside of their object tree.

isWeaklyIsolated
template isWeaklyIsolated(T...)

Determines if the given list of types has any non-immutable and unshared aliasing outside of their object tree.

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.

Authors

Sönke Ludwig