libfoedus-core
FOEDUS Core Library
|
Reader-writer (RW) MCS lock classes. More...
Reader-writer (RW) MCS lock classes.
These are mainly used for record locks.Pre-allocated MCS block for simpler version of RW-locks.
Definition at line 387 of file xct_id.hpp.
#include <xct_id.hpp>
Classes | |
union | Self |
Public Member Functions | |
void | init_reader () |
void | init_writer () |
void | init_common () __attribute__((always_inline)) |
bool | is_reader () __attribute__((always_inline)) |
uint8_t | read_state () |
void | unblock () __attribute__((always_inline)) |
bool | is_blocked () __attribute__((always_inline)) |
bool | is_granted () |
void | set_finalized () |
bool | is_finalized () |
bool | timeout_granted (int32_t timeout) |
MCS block classes. More... | |
void | set_successor_class_writer () |
void | set_successor_next_only (thread::ThreadId thread_id, McsBlockIndex block_index) |
bool | has_successor () |
bool | successor_is_ready () |
bool | has_reader_successor () |
bool | has_writer_successor () |
uint16_t | make_blocked_with_reader_successor_state () |
uint16_t | make_blocked_with_no_successor_state () |
Public Attributes | |
union foedus::xct::McsRwSimpleBlock::Self | self_ |
thread::ThreadId | successor_thread_id_ |
McsBlockIndex | successor_block_index_ |
Static Public Attributes | |
static const uint8_t | kStateClassMask = 3U |
static const uint8_t | kStateClassReaderFlag = 1U |
static const uint8_t | kStateClassWriterFlag = 2U |
static const uint8_t | kStateBlockedFlag = 1U << 7U |
static const uint8_t | kStateBlockedMask = 1U << 7U |
static const uint8_t | kStateFinalizedMask = 4U |
static const uint8_t | kSuccessorClassReader = 1U |
static const uint8_t | kSuccessorClassWriter = 2U |
static const uint8_t | kSuccessorClassNone = 3U |
static const int32_t | kTimeoutNever = 0xFFFFFFFF |
union foedus::xct::McsRwSimpleBlock::Self |
Definition at line 403 of file xct_id.hpp.
Class Members | ||
---|---|---|
struct Components | components_ | |
uint16_t | data_ |
|
inline |
Definition at line 492 of file xct_id.hpp.
References foedus::xct::McsRwSimpleBlock::Self::components_, kSuccessorClassReader, self_, and foedus::xct::McsRwSimpleBlock::Self::Components::successor_class_.
|
inline |
Definition at line 484 of file xct_id.hpp.
References foedus::xct::McsRwSimpleBlock::Self::components_, self_, and foedus::xct::McsRwSimpleBlock::Self::Components::successor_class_.
|
inline |
Definition at line 496 of file xct_id.hpp.
References foedus::xct::McsRwSimpleBlock::Self::components_, kSuccessorClassWriter, self_, and foedus::xct::McsRwSimpleBlock::Self::Components::successor_class_.
|
inline |
Definition at line 428 of file xct_id.hpp.
References foedus::xct::McsRwSimpleBlock::Self::components_, kSuccessorClassNone, foedus::assorted::memory_fence_release(), self_, and foedus::xct::McsRwSimpleBlock::Self::Components::successor_class_.
Referenced by init_reader(), and init_writer().
|
inline |
Definition at line 420 of file xct_id.hpp.
References foedus::xct::McsRwSimpleBlock::Self::components_, init_common(), kStateBlockedFlag, self_, and foedus::xct::McsRwSimpleBlock::Self::Components::state_.
|
inline |
Definition at line 424 of file xct_id.hpp.
References foedus::xct::McsRwSimpleBlock::Self::components_, init_common(), kStateBlockedFlag, self_, and foedus::xct::McsRwSimpleBlock::Self::Components::state_.
|
inline |
Definition at line 447 of file xct_id.hpp.
References kStateBlockedMask, and read_state().
Referenced by is_granted(), and foedus::xct::McsImpl< ADAPTOR, McsRwSimpleBlock >::release_rw_reader().
|
inline |
Definition at line 460 of file xct_id.hpp.
References ASSERT_ND, is_reader(), kStateFinalizedMask, and read_state().
Referenced by set_finalized().
|
inline |
Definition at line 450 of file xct_id.hpp.
References is_blocked().
Referenced by timeout_granted().
|
inline |
Definition at line 435 of file xct_id.hpp.
References foedus::xct::McsRwSimpleBlock::Self::components_, kStateClassReaderFlag, self_, and foedus::xct::McsRwSimpleBlock::Self::Components::state_.
Referenced by is_finalized(), foedus::xct::McsImpl< ADAPTOR, McsRwSimpleBlock >::release_rw_reader(), and set_finalized().
|
inline |
Definition at line 506 of file xct_id.hpp.
References foedus::xct::McsRwSimpleBlock::Self::components_, kStateBlockedFlag, kSuccessorClassNone, self_, and foedus::xct::McsRwSimpleBlock::Self::Components::state_.
|
inline |
Definition at line 501 of file xct_id.hpp.
References foedus::xct::McsRwSimpleBlock::Self::components_, kStateBlockedFlag, kSuccessorClassReader, self_, and foedus::xct::McsRwSimpleBlock::Self::Components::state_.
|
inline |
Definition at line 438 of file xct_id.hpp.
References foedus::xct::McsRwSimpleBlock::Self::components_, self_, and foedus::xct::McsRwSimpleBlock::Self::Components::state_.
Referenced by is_blocked(), is_finalized(), and unblock().
|
inline |
Definition at line 453 of file xct_id.hpp.
References ASSERT_ND, foedus::xct::McsRwSimpleBlock::Self::components_, is_finalized(), is_reader(), kStateFinalizedMask, self_, and foedus::xct::McsRwSimpleBlock::Self::Components::state_.
|
inline |
Definition at line 465 of file xct_id.hpp.
References ASSERT_ND, foedus::xct::McsRwSimpleBlock::Self::components_, kSuccessorClassWriter, self_, and foedus::xct::McsRwSimpleBlock::Self::Components::successor_class_.
|
inline |
Definition at line 473 of file xct_id.hpp.
References ASSERT_ND, foedus::xct::McsRwSimpleBlock::Self::data_, self_, successor_block_index_, and successor_thread_id_.
|
inline |
Definition at line 488 of file xct_id.hpp.
References successor_block_index_.
bool foedus::xct::McsRwSimpleBlock::timeout_granted | ( | int32_t | timeout | ) |
MCS block classes.
Definition at line 133 of file xct_id.cpp.
References is_granted(), kTimeoutNever, foedus::assorted::spin_until(), and foedus::assorted::yield_if_valgrind().
|
inline |
Definition at line 441 of file xct_id.hpp.
References ASSERT_ND, foedus::xct::McsRwSimpleBlock::Self::components_, read_state(), self_, and foedus::xct::McsRwSimpleBlock::Self::Components::state_.
Referenced by foedus::xct::McsImpl< ADAPTOR, McsRwSimpleBlock >::release_rw_reader().
|
static |
Definition at line 392 of file xct_id.hpp.
Referenced by init_reader(), init_writer(), make_blocked_with_no_successor_state(), and make_blocked_with_reader_successor_state().
|
static |
Definition at line 393 of file xct_id.hpp.
Referenced by is_blocked().
|
static |
Definition at line 388 of file xct_id.hpp.
|
static |
Definition at line 389 of file xct_id.hpp.
Referenced by is_reader().
|
static |
Definition at line 390 of file xct_id.hpp.
|
static |
Definition at line 395 of file xct_id.hpp.
Referenced by is_finalized(), and set_finalized().
|
static |
Definition at line 399 of file xct_id.hpp.
Referenced by init_common(), and make_blocked_with_no_successor_state().
|
static |
Definition at line 397 of file xct_id.hpp.
Referenced by has_reader_successor(), and make_blocked_with_reader_successor_state().
|
static |
Definition at line 398 of file xct_id.hpp.
Referenced by has_writer_successor(), and set_successor_class_writer().
|
static |
Definition at line 401 of file xct_id.hpp.
Referenced by timeout_granted().
union foedus::xct::McsRwSimpleBlock::Self foedus::xct::McsRwSimpleBlock::self_ |
Referenced by has_reader_successor(), has_successor(), has_writer_successor(), init_common(), init_reader(), init_writer(), is_reader(), make_blocked_with_no_successor_state(), make_blocked_with_reader_successor_state(), read_state(), set_finalized(), set_successor_class_writer(), set_successor_next_only(), and unblock().
McsBlockIndex foedus::xct::McsRwSimpleBlock::successor_block_index_ |
Definition at line 418 of file xct_id.hpp.
Referenced by set_successor_next_only(), and successor_is_ready().
thread::ThreadId foedus::xct::McsRwSimpleBlock::successor_thread_id_ |
Definition at line 417 of file xct_id.hpp.
Referenced by set_successor_next_only().