tango.core.sync.Atomic

The Atomic module is intended to provide some basic support for the so called lock-free concurrent programming. The current design replaces the previous Atomic module by Sean and is inspired partly by the llvm atomic operations, and Sean's version

If no atomic ops are available an (inefficent) fallback solution is provided For classes atomic access means atomic access to their *address* not their content

If you want unique counters or flags to communicate in multithreading settings look at tango.core.sync.Counter that provides them in a better way and handles better the absence of atomic ops.

Members

Enums

LockVersion
anonymousenum LockVersion
Undocumented in source.
LockVersion
anonymousenum LockVersion
Undocumented in source.
strictFences
anonymousenum strictFences
Undocumented in source.

Functions

OSAtomicCompareAndSwap64
ubyte 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.
atomicAdd
T atomicAdd(T val, T incV)
Undocumented in source. Be warned that the author may not have intended to support it.
atomicAdd
T atomicAdd(T val, U incV_)
Undocumented in source. Be warned that the author may not have intended to support it.
atomicAdd
T atomicAdd(T val, U incV_)
Undocumented in source. Be warned that the author may not have intended to support it.
atomicAdd
T atomicAdd(T val, U incV_)
Undocumented in source. Be warned that the author may not have intended to support it.
atomicAdd
T atomicAdd(T val, U incV_)
Undocumented in source. Be warned that the author may not have intended to support it.
atomicCAS
T atomicCAS(T val, T newval, T equalTo)
Undocumented in source. Be warned that the author may not have intended to support it.
atomicCAS
T atomicCAS(T val, T newval, T equalTo)
Undocumented in source.
atomicCAS
T atomicCAS(T val, T newval, T equalTo)
Undocumented in source.
atomicCAS
T atomicCAS(T val, T newval, T equalTo)
Undocumented in source.
atomicCASB
bool atomicCASB(T val, T newval, T equalTo)
Undocumented in source. Be warned that the author may not have intended to support it.
atomicLoad
T atomicLoad(T val)
Undocumented in source.
atomicOp
T atomicOp(T val, T delegate(T) f)
Undocumented in source. Be warned that the author may not have intended to support it.
atomicStore
void atomicStore(T val, T newVal)
Undocumented in source.
atomicSwap
T atomicSwap(T val, T newval)
Undocumented in source. Be warned that the author may not have intended to support it.
atomicSwap
T atomicSwap(T val, T newval)
Undocumented in source.
atomicSwap
T atomicSwap(T val, T newval)
Undocumented in source.
atomicSwap
T atomicSwap(T val, T newval)
Undocumented in source.
flagAdd
T flagAdd(T flag, T incV)
Undocumented in source. Be warned that the author may not have intended to support it.
flagGet
T flagGet(T flag)
Undocumented in source. Be warned that the author may not have intended to support it.
flagOp
T flagOp(T flag, T delegate(T) op)
Undocumented in source. Be warned that the author may not have intended to support it.
flagSet
T flagSet(T flag, T newVal)
Undocumented in source. Be warned that the author may not have intended to support it.
fullBarrier
void fullBarrier()

Utility function for a full barrier (disallow reorderig.)

memoryBarrier
void memoryBarrier()
Undocumented in source. Be warned that the author may not have intended to support it.
memoryBarrier
void memoryBarrier()
Undocumented in source. Be warned that the author may not have intended to support it.
memoryBarrier
void memoryBarrier()
Undocumented in source. Be warned that the author may not have intended to support it.
nextValue
T nextValue(T val)
Undocumented in source. Be warned that the author may not have intended to support it.
readBarrier
void readBarrier()

Utility function for a read barrier (disallow load and load reorderig.)

thread_yield
void thread_yield()
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
writeBarrier
void writeBarrier()

Utility function for a write barrier (disallow store and store reorderig.)

Templates

atomicValueIsProperlyAligned
template atomicValueIsProperlyAligned(T)
Undocumented in source.

Variables

dummy
int dummy;
Undocumented in source.

Meta

License

BSD style: $(LICENSE)

Authors

Fawzi Mohamed