libfoedus-core
FOEDUS Core Library
|
Exclusive-only (WW) MCS lock classes. More...
Exclusive-only (WW) MCS lock classes.
These are mainly used for page locks. Represents an exclusive-only MCS node, a pair of node-owner (thread) and its block index.
Definition at line 182 of file xct_id.hpp.
#include <xct_id.hpp>
Public Member Functions | |
McsWwBlockData () | |
McsWwBlockData (uint64_t word) | |
McsWwBlockData (uint32_t thread_id, McsBlockIndex block) | |
bool | operator== (const McsWwBlockData &other) const |
bool | operator!= (const McsWwBlockData &other) const |
uint64_t | get_word_acquire () const __attribute__((always_inline)) |
uint64_t | get_word_consume () const __attribute__((always_inline)) |
uint64_t | get_word_atomic () const __attribute__((always_inline)) |
uint64_t | get_word_once () const __attribute__((always_inline)) |
The access_once semantics, which is widely used in linux. More... | |
McsWwBlockData | copy_once () const __attribute__((always_inline)) |
McsWwBlockData | copy_consume () const __attribute__((always_inline)) |
McsWwBlockData | copy_acquire () const __attribute__((always_inline)) |
McsWwBlockData | copy_atomic () const __attribute__((always_inline)) |
bool | is_valid_relaxed () const __attribute__((always_inline)) |
bool | is_valid_consume () const __attribute__((always_inline)) |
bool | is_valid_acquire () const __attribute__((always_inline)) |
bool | is_valid_atomic () const __attribute__((always_inline)) |
bool | is_guest_relaxed () const __attribute__((always_inline)) |
bool | is_guest_acquire () const __attribute__((always_inline)) |
bool | is_guest_consume () const __attribute__((always_inline)) |
bool | is_guest_atomic () const __attribute__((always_inline)) |
uint32_t | get_thread_id_relaxed () const __attribute__((always_inline)) |
Carefully use this! In some places you must call get_word_once() then call this on the copy. More... | |
McsBlockIndex | get_block_relaxed () const __attribute__((always_inline)) |
Carefully use this! In some places you must call get_word_once() then call this on the copy. More... | |
void | clear () __attribute__((always_inline)) |
void | clear_atomic () __attribute__((always_inline)) |
void | clear_release () __attribute__((always_inline)) |
void | set_relaxed (uint32_t thread_id, McsBlockIndex block) __attribute__((always_inline)) |
void | set_atomic (uint32_t thread_id, McsBlockIndex block) __attribute__((always_inline)) |
void | set_release (uint32_t thread_id, McsBlockIndex block) __attribute__((always_inline)) |
void | set_combined_atomic (uint64_t word) __attribute__((always_inline)) |
void | set_combined_release (uint64_t word) __attribute__((always_inline)) |
Static Public Member Functions | |
static uint64_t | combine (uint32_t thread_id, McsBlockIndex block) __attribute__((always_inline)) |
static uint32_t | decompose_thread_id (uint64_t word) __attribute__((always_inline)) |
static McsBlockIndex | decompose_block (uint64_t word) __attribute__((always_inline)) |
Public Attributes | |
uint64_t | word_ |
The high 32-bits is thread_id, the low 32-bit is block-index. More... | |
|
inline |
Definition at line 204 of file xct_id.hpp.
Referenced by copy_acquire(), copy_atomic(), copy_consume(), and copy_once().
|
inlineexplicit |
Definition at line 205 of file xct_id.hpp.
|
inline |
Definition at line 206 of file xct_id.hpp.
|
inline |
Definition at line 253 of file xct_id.hpp.
Referenced by foedus::xct::McsWwLock::McsWwLock(), and foedus::xct::McsWwLock::reset().
|
inline |
Definition at line 254 of file xct_id.hpp.
References word_.
Referenced by foedus::xct::McsWwBlock::clear_successor_atomic().
|
inline |
Definition at line 255 of file xct_id.hpp.
References word_.
Referenced by foedus::xct::McsWwBlock::clear_successor_release().
|
inlinestatic |
Definition at line 191 of file xct_id.hpp.
Referenced by set_atomic(), set_relaxed(), and set_release().
|
inline |
Definition at line 227 of file xct_id.hpp.
References get_word_acquire(), and McsWwBlockData().
Referenced by foedus::xct::McsWwLock::get_tail_acquire().
|
inline |
Definition at line 228 of file xct_id.hpp.
References get_word_atomic(), and McsWwBlockData().
Referenced by foedus::xct::McsWwLock::get_tail_atomic().
|
inline |
Definition at line 226 of file xct_id.hpp.
References get_word_consume(), and McsWwBlockData().
Referenced by foedus::xct::McsWwLock::get_tail_consume().
|
inline |
Definition at line 225 of file xct_id.hpp.
References get_word_once(), and McsWwBlockData().
Referenced by foedus::xct::McsWwLock::get_tail_once().
|
inlinestatic |
Definition at line 200 of file xct_id.hpp.
Referenced by get_block_relaxed().
|
inlinestatic |
Definition at line 197 of file xct_id.hpp.
Referenced by get_thread_id_relaxed().
|
inline |
Carefully use this! In some places you must call get_word_once() then call this on the copy.
We thus put "_relaxed" as suffix.
Definition at line 250 of file xct_id.hpp.
References decompose_block().
Referenced by foedus::xct::McsWwImpl< ADAPTOR >::acquire_unconditional(), foedus::xct::McsWwBlock::get_successor_block_relaxed(), and foedus::xct::McsWwLock::get_tail_waiter_block().
|
inline |
Carefully use this! In some places you must call get_word_once() then call this on the copy.
We thus put "_relaxed" as suffix.
Definition at line 243 of file xct_id.hpp.
References decompose_thread_id().
Referenced by foedus::xct::McsWwImpl< ADAPTOR >::acquire_try(), foedus::xct::McsWwImpl< ADAPTOR >::acquire_unconditional(), foedus::xct::McsWwBlock::get_successor_thread_id_relaxed(), and foedus::xct::McsWwLock::get_tail_waiter().
|
inline |
Definition at line 211 of file xct_id.hpp.
References word_.
Referenced by copy_acquire(), is_guest_acquire(), and is_valid_acquire().
|
inline |
Definition at line 217 of file xct_id.hpp.
References word_.
Referenced by copy_atomic(), is_guest_atomic(), and is_valid_atomic().
|
inline |
Definition at line 214 of file xct_id.hpp.
References word_.
Referenced by copy_consume(), is_guest_consume(), and is_valid_consume().
|
inline |
The access_once semantics, which is widely used in linux.
This is weaker than get_word_atomic(), but enough for many places.
Definition at line 224 of file xct_id.hpp.
References word_.
Referenced by copy_once().
|
inline |
Definition at line 236 of file xct_id.hpp.
References get_word_acquire(), and foedus::xct::kMcsGuestId.
|
inline |
Definition at line 238 of file xct_id.hpp.
References get_word_atomic(), and foedus::xct::kMcsGuestId.
|
inline |
Definition at line 237 of file xct_id.hpp.
References get_word_consume(), and foedus::xct::kMcsGuestId.
|
inline |
Definition at line 235 of file xct_id.hpp.
References foedus::xct::kMcsGuestId.
Referenced by foedus::xct::McsWwImpl< ADAPTOR >::acquire_try(), foedus::xct::McsWwImpl< ADAPTOR >::acquire_unconditional(), foedus::xct::McsWwOwnerlessImpl::ownerless_release(), and foedus::xct::McsWwImpl< ADAPTOR >::release().
|
inline |
Definition at line 232 of file xct_id.hpp.
References get_word_acquire().
Referenced by foedus::xct::McsWwBlock::has_successor_acquire().
|
inline |
Definition at line 233 of file xct_id.hpp.
References get_word_atomic().
Referenced by foedus::xct::McsWwBlock::has_successor_atomic().
|
inline |
Definition at line 231 of file xct_id.hpp.
References get_word_consume().
Referenced by foedus::xct::McsWwBlock::has_successor_consume().
|
inline |
Definition at line 230 of file xct_id.hpp.
Referenced by foedus::xct::McsWwImpl< ADAPTOR >::acquire_try(), foedus::xct::McsWwImpl< ADAPTOR >::acquire_unconditional(), foedus::xct::McsWwBlock::has_successor_relaxed(), foedus::xct::McsWwLock::is_locked(), foedus::xct::McsWwOwnerlessImpl::ownerless_acquire_try(), foedus::xct::McsWwOwnerlessImpl::ownerless_acquire_unconditional(), foedus::xct::McsWwOwnerlessImpl::ownerless_release(), and foedus::xct::McsWwImpl< ADAPTOR >::release().
|
inline |
Definition at line 209 of file xct_id.hpp.
References word_.
|
inline |
Definition at line 208 of file xct_id.hpp.
References word_.
|
inline |
Definition at line 259 of file xct_id.hpp.
References combine(), and set_combined_atomic().
Referenced by foedus::xct::McsWwLock::reset_atomic(), and foedus::xct::McsWwBlock::set_successor_atomic().
|
inline |
Definition at line 265 of file xct_id.hpp.
References word_.
Referenced by set_atomic().
|
inline |
Definition at line 268 of file xct_id.hpp.
References word_.
Referenced by foedus::xct::McsWwLock::reset_guest_id_release(), and set_release().
|
inline |
Definition at line 256 of file xct_id.hpp.
References combine().
Referenced by foedus::xct::McsWwLock::McsWwLock(), and foedus::xct::McsWwLock::reset().
|
inline |
Definition at line 262 of file xct_id.hpp.
References combine(), and set_combined_release().
Referenced by foedus::xct::McsWwLock::reset_release(), and foedus::xct::McsWwBlock::set_successor_release().
uint64_t foedus::xct::McsWwBlockData::word_ |
The high 32-bits is thread_id, the low 32-bit is block-index.
We so far need only 16-bits each, but reserved more bits for future use. We previously used union for this, but it caused many "accidentally non-access-once" bugs. We thus avoid using union. Not saying that union is wrong, but it's prone to such coding.
Definition at line 189 of file xct_id.hpp.
Referenced by foedus::xct::McsWwImpl< ADAPTOR >::acquire_try(), foedus::xct::McsWwImpl< ADAPTOR >::acquire_unconditional(), clear_atomic(), clear_release(), get_word_acquire(), get_word_atomic(), get_word_consume(), get_word_once(), operator!=(), operator==(), foedus::xct::McsWwOwnerlessImpl::ownerless_acquire_try(), foedus::xct::McsWwOwnerlessImpl::ownerless_acquire_unconditional(), foedus::xct::McsWwOwnerlessImpl::ownerless_release(), foedus::xct::McsWwImpl< ADAPTOR >::release(), set_combined_atomic(), and set_combined_release().