library of assembled shared sources |
http://lass.cocamware.com |
Data Structures | |
class | lass::util::TaggedPtr< T > |
Pointer with a tag for ABA salvation
Some lock-free algorithms suffer from the ABA problem when acting on pointers. More... | |
struct | lass::util::impl::AtomicOperations< 1 > |
struct | lass::util::impl::AtomicOperations< 2 > |
struct | lass::util::impl::AtomicOperations< 4 > |
struct | lass::util::impl::AtomicOperations< 8 > |
Functions | |
template<typename T > | |
bool | lass::util::atomicCompareAndSwap (volatile T &dest, T expectedValue, T newValue) |
Performs the following pseudocode in an atomic way (no other threads can intervene):. | |
template<typename T1 , typename T2 > | |
bool | lass::util::atomicCompareAndSwap (volatile T1 &dest1, T1 expected1, T2 expected2, T1 new1, T2 new2) |
Performs the following pseudocode in an atomic way (no other threads can intervene):. | |
template<typename T > | |
void | lass::util::atomicIncrement (volatile T &value) |
Performs the following pseudocode in an atomic way (no other threads can intervene):. | |
template<typename T > | |
void | lass::util::atomicDecrement (volatile T &value) |
Performs the following pseudocode in an atomic way (no other threads can intervene):. |
bool lass::util::atomicCompareAndSwap | ( | volatile T & | dest, | |
T | expectedValue, | |||
T | newValue | |||
) | [inline] |
Performs the following pseudocode in an atomic way (no other threads can intervene):.
if (dest != expectedValue) return false; dest = newValue; return true;
Definition at line 69 of file atomic.h.
Referenced by lass::util::ThreadPool< TaskType, ConsumerType, IdlePolicy, ParticipationPolicy >::addTask(), lass::util::impl::SingletonGuard::CustomSemaphore::CustomSemaphore(), lass::util::IntrusiveCounter< T, CounterType, referenceCounter >::decrement(), lass::util::DefaultCounter::decrement(), lass::util::impl::AtomicOperations< 8 >::decrement(), lass::util::impl::heapCounterAllocator(), lass::util::IntrusiveCounter< T, CounterType, referenceCounter >::increment(), lass::util::DefaultCounter::increment(), lass::util::impl::AtomicOperations< 8 >::increment(), lass::util::Semaphore::lock(), lass::util::RWLock::lockr(), lass::util::Semaphore::tryLock(), and lass::util::RWLock::tryLockr().
bool lass::util::atomicCompareAndSwap | ( | volatile T1 & | dest1, | |
T1 | expected1, | |||
T2 | expected2, | |||
T1 | new1, | |||
T2 | new2 | |||
) | [inline] |
Performs the following pseudocode in an atomic way (no other threads can intervene):.
if (dest1 != expectedValue1 || *(T2*)(&dest1 + sizeof(T1)) != expected2) return false; dest1 = new1; dest2 = new2; return true;
Does not exist for 64-bit types (there's no 128-bit CAS).
Definition at line 90 of file atomic.h.
References LASS_META_ASSERT.
void lass::util::atomicIncrement | ( | volatile T & | value | ) | [inline] |
Performs the following pseudocode in an atomic way (no other threads can intervene):.
++value;
Definition at line 107 of file atomic.h.
Referenced by lass::util::ThreadPool< TaskType, ConsumerType, IdlePolicy, ParticipationPolicy >::ConsumerThread::doRun(), lass::util::impl::heapCounterAllocator(), lass::util::RWLock::lockw(), lass::util::RWLock::tryLockw(), lass::util::Semaphore::unlock(), lass::util::RWLock::unlockr(), and lass::util::impl::SingletonGuard::CustomSemaphore::~CustomSemaphore().
void lass::util::atomicDecrement | ( | volatile T & | value | ) | [inline] |
Performs the following pseudocode in an atomic way (no other threads can intervene):.
--value;
Definition at line 122 of file atomic.h.
Referenced by lass::util::ThreadPool< TaskType, ConsumerType, IdlePolicy, ParticipationPolicy >::completeAllTasks(), lass::util::ThreadPool< TaskType, ConsumerType, IdlePolicy, ParticipationPolicy >::ConsumerThread::doRun(), lass::util::RWLock::tryLockw(), and lass::util::RWLock::unlockw().
Generated on Mon Nov 10 14:22:06 2008 for Library of Assembled Shared Sources by 1.5.7.1 |