18 #ifndef FOEDUS_XCT_XCT_MCS_IMPL_HPP_
19 #define FOEDUS_XCT_XCT_MCS_IMPL_HPP_
86 template<
typename ADAPTOR,
typename RW_BLOCK>
89 explicit McsImpl(ADAPTOR adaptor) : adaptor_(adaptor) {}
181 template<
typename ADAPTOR>
184 explicit McsWwImpl(ADAPTOR adaptor) : adaptor_(adaptor) {}
240 #endif // FOEDUS_XCT_XCT_MCS_IMPL_HPP_
McsBlockIndex initial(McsWwLock *lock)
[WW] This doesn't use any atomic operation.
static void ownerless_release(McsWwLock *lock)
McsBlockIndex acquire_try_rw_reader(McsRwLock *lock)
Try-acquire.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
McsBlockIndex acquire_unconditional_rw_writer(McsRwLock *lock)
[RW] Unconditionally takes a writer lock.
void cancel_async_rw_reader(McsRwLock *lock, McsBlockIndex block_index)
[RW] Cancels the lock request.
Forward declarations of classes in transaction package.
void release(McsWwLock *lock, McsBlockIndex block_index)
[WW] Unlcok an MCS lock acquired by this thread.
AcquireAsyncRet acquire_async_rw_writer(McsRwLock *lock)
[RW] Asynchronously try to take a writer lock.
static void ownerless_initial(McsWwLock *lock)
bool retry_async_rw_reader(McsRwLock *lock, McsBlockIndex block_index)
[RW] Returns whether the lock requeust is now granted.
McsWwOwnerlessImpl()=delete
Return value of acquire_async_rw.
Definitions of IDs in this package and a few related constant values.
An exclusive-only (WW) MCS lock data structure.
Implements an MCS-locking Algorithm.
void release_rw_reader(McsRwLock *lock, McsBlockIndex block_index)
Release and other stuffs.
static bool ownerless_acquire_try(McsWwLock *lock)
[WW-Guest] Try to take an exclusive guest lock on the given MCSg lock.
McsBlockIndex acquire_unconditional(McsWwLock *lock)
[WW] Unconditionally takes exclusive-only MCS lock on the given lock.
A specialized/simplified implementation of an MCS-locking Algorithm for exclusive-only (WW) locks...
McsBlockIndex acquire_try_rw_writer(McsRwLock *lock)
[RW] Try to take a writer lock.
McsBlockIndex acquire_unconditional_rw_reader(McsRwLock *lock)
RW-lock methods: BEGIN.
static bool does_support_try_rw_reader()
McsWwImpl(ADAPTOR adaptor)
void release_rw_writer(McsRwLock *lock, McsBlockIndex block_index)
[RW] Releases a writer lock.
McsBlockIndex acquire_try(McsWwLock *lock)
[WW] Try to take an exclusive lock.
uint32_t McsBlockIndex
Index in thread-local MCS block.
A ownerless (contextless) interface for McsWwImpl.
void cancel_async_rw_writer(McsRwLock *lock, McsBlockIndex block_index)
~McsWwOwnerlessImpl()=delete
bool retry_async_rw_writer(McsRwLock *lock, McsBlockIndex block_index)
static void ownerless_acquire_unconditional(McsWwLock *lock)
[WW-Guest] Unconditionally takes exclusive-only guest lock on the given MCSg lock.
AcquireAsyncRet acquire_async_rw_reader(McsRwLock *lock)
Async-acquire trios (acquire, cancel, retry)
An MCS reader-writer lock data structure.