libfoedus-core
FOEDUS Core Library
|
An exclusive-only (WW) MCS lock data structure. More...
An exclusive-only (WW) MCS lock data structure.
This is the minimal unit of locking in our system. Unlike SILO, we employ MCS locking that scales much better on big machines. This object stores tail-waiter, which indicates the thread that is in the tail of the queue lock, which might be the owner of the lock. The MCS-lock nodes are pre-allocated for each thread and placed in shared memory.
This is the original MCSg lock implementation without cancel/RW functionality. It has the guest functionality used by background threads to take page locks.
Definition at line 324 of file xct_id.hpp.
#include <xct_id.hpp>
Public Member Functions | |
McsWwLock () | |
McsWwLock (thread::ThreadId tail_waiter, McsBlockIndex tail_waiter_block) | |
McsWwLock (const McsWwLock &other)=delete | |
McsWwLock & | operator= (const McsWwLock &other)=delete |
bool | is_locked () const |
This is a "relaxed" check. More... | |
void | ownerless_initial_lock () |
The followings are implemented in thread_pimpl.cpp along with the above methods, but these don't use any of Thread's context information. More... | |
void | ownerless_acquire_lock () |
void | ownerless_release_lock () |
thread::ThreadId | get_tail_waiter () const __attribute__((always_inline)) |
This is a "relaxed" check. More... | |
McsBlockIndex | get_tail_waiter_block () const __attribute__((always_inline)) |
This is a "relaxed" check. More... | |
McsWwBlockData | get_tail_relaxed () const __attribute__((always_inline)) |
McsWwBlockData | get_tail_once () const __attribute__((always_inline)) |
McsWwBlockData | get_tail_consume () const __attribute__((always_inline)) |
McsWwBlockData | get_tail_acquire () const __attribute__((always_inline)) |
McsWwBlockData | get_tail_atomic () const __attribute__((always_inline)) |
void | reset () __attribute__((always_inline)) |
used only while page initialization More... | |
void | reset_guest_id_release () |
void | reset (thread::ThreadId tail_waiter, McsBlockIndex tail_waiter_block) __attribute__((always_inline)) |
used only for initial_lock() More... | |
void | reset_atomic () __attribute__((always_inline)) |
void | reset_atomic (thread::ThreadId tail_waiter, McsBlockIndex tail_waiter_block) __attribute__((always_inline)) |
void | reset_release () __attribute__((always_inline)) |
void | reset_release (thread::ThreadId tail_waiter, McsBlockIndex tail_waiter_block) __attribute__((always_inline)) |
Public Attributes | |
McsWwBlockData | tail_ |
Friends | |
std::ostream & | operator<< (std::ostream &o, const McsWwLock &v) |
Debug out operators. More... | |
|
inline |
Definition at line 325 of file xct_id.hpp.
References foedus::xct::McsWwBlockData::clear(), and tail_.
|
inline |
Definition at line 326 of file xct_id.hpp.
References foedus::xct::McsWwBlockData::set_relaxed(), and tail_.
|
delete |
|
inline |
Definition at line 351 of file xct_id.hpp.
References foedus::xct::McsWwBlockData::copy_acquire(), and tail_.
|
inline |
Definition at line 352 of file xct_id.hpp.
References foedus::xct::McsWwBlockData::copy_atomic(), and tail_.
|
inline |
Definition at line 350 of file xct_id.hpp.
References foedus::xct::McsWwBlockData::copy_consume(), and tail_.
|
inline |
Definition at line 349 of file xct_id.hpp.
References foedus::xct::McsWwBlockData::copy_once(), and tail_.
|
inline |
|
inline |
This is a "relaxed" check.
Use with caution.
Definition at line 344 of file xct_id.hpp.
References foedus::xct::McsWwBlockData::get_thread_id_relaxed(), and tail_.
Referenced by foedus::xct::operator<<(), and foedus::xct::McsWwImpl< ADAPTOR >::release().
|
inline |
This is a "relaxed" check.
Use with caution.
Definition at line 346 of file xct_id.hpp.
References foedus::xct::McsWwBlockData::get_block_relaxed(), and tail_.
Referenced by foedus::xct::operator<<().
|
inline |
This is a "relaxed" check.
Use with caution. I should have named this is_locked_relaxed..
Definition at line 334 of file xct_id.hpp.
References foedus::xct::McsWwBlockData::is_valid_relaxed(), and tail_.
Referenced by foedus::xct::McsWwImpl< ADAPTOR >::acquire_try(), foedus::xct::McsWwImpl< ADAPTOR >::acquire_unconditional(), foedus::xct::McsWwImpl< ADAPTOR >::initial(), foedus::xct::LockableXctId::is_keylocked(), foedus::storage::PageVersion::is_locked(), foedus::xct::operator<<(), foedus::xct::McsWwOwnerlessImpl::ownerless_acquire_try(), foedus::xct::McsWwOwnerlessImpl::ownerless_acquire_unconditional(), foedus::xct::McsWwOwnerlessImpl::ownerless_initial(), foedus::xct::McsWwOwnerlessImpl::ownerless_release(), and foedus::xct::McsWwImpl< ADAPTOR >::release().
void foedus::xct::McsWwLock::ownerless_acquire_lock | ( | ) |
Definition at line 78 of file xct_id.cpp.
References foedus::xct::McsWwOwnerlessImpl::ownerless_acquire_unconditional().
Referenced by foedus::xct::McsOwnerlessLockScope::acquire().
void foedus::xct::McsWwLock::ownerless_initial_lock | ( | ) |
The followings are implemented in thread_pimpl.cpp along with the above methods, but these don't use any of Thread's context information.
Definition at line 86 of file xct_id.cpp.
References foedus::xct::McsWwOwnerlessImpl::ownerless_initial().
Referenced by foedus::xct::McsOwnerlessLockScope::acquire().
void foedus::xct::McsWwLock::ownerless_release_lock | ( | ) |
Definition at line 82 of file xct_id.cpp.
References foedus::xct::McsWwOwnerlessImpl::ownerless_release().
Referenced by foedus::xct::McsOwnerlessLockScope::release().
|
inline |
used only while page initialization
Definition at line 355 of file xct_id.hpp.
References foedus::xct::McsWwBlockData::clear(), and tail_.
Referenced by foedus::xct::McsMockDataPage::init(), foedus::storage::PageVersion::reset(), and foedus::xct::LockableXctId::reset().
|
inline |
used only for initial_lock()
Definition at line 362 of file xct_id.hpp.
References foedus::xct::McsWwBlockData::set_relaxed(), and tail_.
|
inline |
Definition at line 366 of file xct_id.hpp.
References reset_atomic().
Referenced by reset_atomic().
|
inline |
Definition at line 367 of file xct_id.hpp.
References foedus::xct::McsWwBlockData::set_atomic(), and tail_.
|
inline |
Definition at line 357 of file xct_id.hpp.
References foedus::xct::McsWwBlockData::set_combined_release(), and tail_.
Referenced by foedus::xct::McsWwOwnerlessImpl::ownerless_initial().
|
inline |
Definition at line 370 of file xct_id.hpp.
References reset_release().
Referenced by foedus::xct::McsWwImpl< ADAPTOR >::initial(), and reset_release().
|
inline |
Definition at line 371 of file xct_id.hpp.
References foedus::xct::McsWwBlockData::set_release(), and tail_.
|
friend |
Debug out operators.
Definition at line 171 of file xct_id.cpp.
McsWwBlockData foedus::xct::McsWwLock::tail_ |
Definition at line 377 of file xct_id.hpp.
Referenced by foedus::xct::McsWwImpl< ADAPTOR >::acquire_try(), foedus::xct::McsWwImpl< ADAPTOR >::acquire_unconditional(), get_tail_acquire(), get_tail_atomic(), get_tail_consume(), get_tail_once(), get_tail_relaxed(), get_tail_waiter(), get_tail_waiter_block(), is_locked(), McsWwLock(), foedus::xct::McsWwOwnerlessImpl::ownerless_acquire_try(), foedus::xct::McsWwOwnerlessImpl::ownerless_acquire_unconditional(), foedus::xct::McsWwOwnerlessImpl::ownerless_release(), foedus::xct::McsWwImpl< ADAPTOR >::release(), reset(), reset_atomic(), reset_guest_id_release(), and reset_release().