tango.core.Atomic

The atomic module is intended to provide some basic support for lock-free concurrent programming. Some common operations are defined, each of which may be performed using the specified memory barrier or a less granular barrier if the hardware does not support the version requested. This model is based on a design by Alexander Terekhov as outlined in this thread. Another useful reference for memory ordering on modern architectures is this article by Paul McKenney.

Members

Enums

msync
deprecated enum msync

Memory synchronization flag. If the supplied option is not available on the current platform then a stronger method will be used instead.

Functions

OSAtomicCompareAndSwap64
deprecated bool OSAtomicCompareAndSwap64(long oldValue, long newValue, long* theValue)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
OSAtomicCompareAndSwap64Barrier
deprecated bool OSAtomicCompareAndSwap64Barrier(long oldValue, long newValue, long* theValue)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
main
deprecated void main()

///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

Structs

Atomic
deprecated struct Atomic(T)

This struct represents a value which will be subject to competing access. All accesses to this value will be synchronized with main memory, and various memory barriers may be employed for instruction ordering. Any primitive type of size equal to or smaller than the memory bus size is allowed, so 32-bit machines may use values with size <= int.sizeof and 64-bit machines may use values with size <= long.sizeof. The one exception to this rule is that architectures that support DCAS will allow double-wide storeIf operations. The 32-bit x86 architecture, for example, supports 64-bit storeIf operations.

Templates

atomicDecrement
deprecated template atomicDecrement(msync ms, T)

Supported msync values: msync.raw, msync.ssb, msync.acq, msync.rel, msync.seq

atomicDecrement
deprecated template atomicDecrement(msync ms = msync.seq, T)

///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

atomicDecrement
deprecated template atomicDecrement(msync ms = msync.seq, T)

///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

atomicDecrement
deprecated template atomicDecrement(msync ms = msync.seq, T)

///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

atomicIncrement
deprecated template atomicIncrement(msync ms, T)

Supported msync values: msync.raw, msync.ssb, msync.acq, msync.rel, msync.seq

atomicIncrement
deprecated template atomicIncrement(msync ms = msync.seq, T)

///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

atomicIncrement
deprecated template atomicIncrement(msync ms = msync.seq, T)

///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

atomicIncrement
deprecated template atomicIncrement(msync ms = msync.seq, T)

////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

atomicLoad
deprecated template atomicLoad(msync ms, T)

Supported msync values: msync.raw, msync.hlb, msync.acq, msync.seq

atomicLoad
deprecated template atomicLoad(msync ms = msync.seq, T)

///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

atomicLoad
deprecated template atomicLoad(msync ms = msync.seq, T)

///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

atomicLoad
deprecated template atomicLoad(msync ms = msync.seq, T)

///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

atomicStore
deprecated template atomicStore(msync ms, T)

Supported msync values: msync.raw, msync.ssb, msync.acq, msync.rel, msync.seq

atomicStore
deprecated template atomicStore(msync ms = msync.seq, T)

///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

atomicStore
deprecated template atomicStore(msync ms = msync.seq, T)

///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

atomicStore
deprecated template atomicStore(msync ms = msync.seq, T)

///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

atomicStoreIf
deprecated template atomicStoreIf(msync ms, T)

Supported msync values: msync.raw, msync.ssb, msync.acq, msync.rel, msync.seq

atomicStoreIf
deprecated template atomicStoreIf(msync ms = msync.seq, T)

///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

atomicStoreIf
deprecated template atomicStoreIf(msync ms = msync.seq, T)

///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

atomicStoreIf
deprecated template atomicStoreIf(msync ms = msync.seq, T)

///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

Meta

License

BSD style: $(LICENSE)

Authors

Sean Kelly