libfoedus-core
FOEDUS Core Library
|
Represents a pointer to another page (usually a child page). More...
Represents a pointer to another page (usually a child page).
All page pointers in our storages have duality; a pointer to volatile page and a pointer to snapshot page. The volatile pointer always points to the latest in-memory image of the page. The snapshot page points to a potentially-stale snapshot image of the page which is guaranteed to be read only in all regards, even in its descendent pages.
None, either, or both of the two pointers might null.
Dual page pointer is, unfortunately, 128 bits. When we have to atomically swap either or both 64-bit parts depending on the current value of the entire 128 bit, we need a double-word CAS. The current implementation uses a processor-specific assembly, assuming recent processors. This might restrict our portability, so let's minimize the use of this operation and revisit the design. Do we really need atomic swap for this object?
This is a POD struct. Default destructor/copy-constructor/assignment operator work fine.
Definition at line 271 of file storage_id.hpp.
#include <storage_id.hpp>
Public Member Functions | |
DualPagePointer () | |
bool | operator== (const DualPagePointer &other) const |
bool | operator!= (const DualPagePointer &other) const |
bool | atomic_compare_exchange_strong (const DualPagePointer &expected, const DualPagePointer &desired) |
128-bit atomic CAS (strong version) for the dual pointer. More... | |
bool | atomic_compare_exchange_weak (const DualPagePointer &expected, const DualPagePointer &desired) |
128-bit atomic CAS (weak version) for the dual pointer. More... | |
bool | is_both_null () const |
Public Attributes | |
SnapshotPagePointer | snapshot_pointer_ |
VolatilePagePointer | volatile_pointer_ |
Friends | |
std::ostream & | operator<< (std::ostream &o, const DualPagePointer &v) |
|
inline |
Definition at line 272 of file storage_id.hpp.
References volatile_pointer_, and foedus::storage::VolatilePagePointer::word.
|
inline |
128-bit atomic CAS (strong version) for the dual pointer.
Definition at line 287 of file storage_id.hpp.
References foedus::assorted::raw_atomic_compare_exchange_strong_uint128().
|
inline |
128-bit atomic CAS (weak version) for the dual pointer.
Definition at line 295 of file storage_id.hpp.
References foedus::assorted::raw_atomic_compare_exchange_weak_uint128().
|
inline |
Definition at line 303 of file storage_id.hpp.
References foedus::storage::VolatilePagePointer::is_null(), snapshot_pointer_, and volatile_pointer_.
Referenced by foedus::storage::masstree::MasstreeStoragePimpl::follow_page(), foedus::storage::masstree::SplitIntermediate::migrate_pointers(), foedus::storage::hash::operator<<(), foedus::storage::masstree::MasstreeIntermediatePage::verify_separators(), foedus::storage::masstree::MasstreeStoragePimpl::verify_single_thread_border(), and foedus::storage::masstree::MasstreeStoragePimpl::verify_single_thread_intermediate().
|
inline |
Definition at line 280 of file storage_id.hpp.
References operator==().
|
inline |
Definition at line 276 of file storage_id.hpp.
References snapshot_pointer_, volatile_pointer_, and foedus::storage::VolatilePagePointer::word.
Referenced by operator!=().
|
friend |
Definition at line 56 of file storage_id.cpp.
SnapshotPagePointer foedus::storage::DualPagePointer::snapshot_pointer_ |
Definition at line 307 of file storage_id.hpp.
Referenced by foedus::storage::masstree::Adopt::adopt_case_b(), foedus::storage::masstree::MasstreeIntermediatePage::append_minipage_snapshot(), foedus::storage::masstree::MasstreeBorderPage::append_next_layer_snapshot(), foedus::storage::masstree::MasstreeIntermediatePage::append_pointer_snapshot(), foedus::storage::sequential::SequentialComposer::compose(), foedus::storage::array::ArrayComposer::construct_root(), foedus::storage::masstree::MasstreeComposer::construct_root(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread_data(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread_follow(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread_intermediate(), foedus::storage::masstree::SplitIntermediate::decide_strategy(), foedus::storage::array::ArrayPartitioner::design_partition(), foedus::storage::masstree::MasstreePartitioner::design_partition(), foedus::storage::array::ArrayComposer::drop_volatiles(), foedus::storage::hash::HashComposer::drop_volatiles(), foedus::storage::hash::HashStoragePimpl::follow_page(), foedus::storage::hash::HashStoragePimpl::follow_page_bin_head(), foedus::thread::ThreadPimpl::follow_page_pointer(), foedus::thread::ThreadPimpl::follow_page_pointers_for_read_batch(), foedus::thread::ThreadPimpl::follow_page_pointers_for_write_batch(), foedus::storage::hash::ComposedBinsMergedStream::init(), foedus::storage::StorageControlBlock::initialize(), foedus::storage::masstree::MasstreeBorderPage::initialize_as_layer_root_physical(), foedus::storage::StorageManagerPimpl::initialize_read_latest_snapshot(), foedus::storage::sequential::SequentialPage::initialize_snapshot_page(), foedus::storage::sequential::SequentialPage::initialize_volatile_page(), foedus::thread::ThreadPimpl::install_a_volatile_page(), is_both_null(), foedus::storage::array::ArrayStoragePimpl::load(), foedus::storage::array::ArrayStoragePimpl::load_empty(), foedus::storage::masstree::MasstreeStoragePimpl::load_empty(), foedus::storage::hash::HashStoragePimpl::locate_record_in_snapshot(), foedus::storage::hash::ComposedBinsMergedStream::open_path(), foedus::storage::operator<<(), operator==(), foedus::storage::masstree::MasstreeStoragePimpl::prefetch_pages_follow(), foedus::storage::array::ArrayStoragePimpl::prefetch_pages_recurse(), foedus::storage::hash::ComposedBinsMergedStream::process_a_bin(), foedus::storage::StorageManagerPimpl::reinitialize_for_recovered_snapshot(), foedus::storage::masstree::MasstreeBorderPage::replace_next_layer_snapshot(), foedus::storage::masstree::ReserveRecords::run(), and foedus::storage::hash::HashStoragePimpl::track_moved_record_search().
VolatilePagePointer foedus::storage::DualPagePointer::volatile_pointer_ |
Definition at line 308 of file storage_id.hpp.
Referenced by foedus::storage::masstree::Adopt::adopt_case_b(), foedus::storage::masstree::MasstreeIntermediatePage::append_minipage_snapshot(), foedus::storage::masstree::MasstreeBorderPage::append_next_layer_snapshot(), foedus::storage::masstree::MasstreeIntermediatePage::append_pointer_snapshot(), foedus::storage::sequential::SequentialStoragePimpl::append_record(), foedus::storage::hash::ReserveRecords::create_new_record_in_tail_page(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread_data(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread_follow(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread_intermediate(), foedus::storage::masstree::SplitIntermediate::decide_strategy(), foedus::storage::array::ArrayPartitioner::design_partition(), foedus::storage::masstree::MasstreePartitioner::design_partition(), foedus::storage::masstree::design_partition_first_parallel_recurse(), foedus::storage::hash::HashPartitioner::design_partition_task(), foedus::storage::array::ArrayComposer::drop_root_volatile(), foedus::storage::hash::HashComposer::drop_root_volatile(), foedus::storage::masstree::MasstreeComposer::drop_root_volatile(), foedus::storage::array::ArrayComposer::drop_volatiles(), foedus::storage::hash::HashComposer::drop_volatiles(), foedus::storage::masstree::MasstreeComposer::drop_volatiles(), foedus::storage::sequential::SequentialComposer::drop_volatiles(), DualPagePointer(), foedus::storage::hash::ReserveRecords::find_and_lock_spacious_tail(), foedus::storage::hash::ReserveRecords::find_or_create_or_expand(), foedus::storage::hash::HashStoragePimpl::follow_page_bin_head(), foedus::thread::ThreadPimpl::follow_page_pointer(), foedus::thread::ThreadPimpl::follow_page_pointers_for_read_batch(), foedus::thread::ThreadPimpl::follow_page_pointers_for_write_batch(), foedus::storage::masstree::grow_case_a_common(), foedus::storage::masstree::grow_case_b_common(), foedus::storage::array::ArrayStoragePimpl::hcc_reset_all_temperature_stat(), foedus::storage::hash::HashStoragePimpl::hcc_reset_all_temperature_stat(), foedus::storage::masstree::MasstreeStoragePimpl::hcc_reset_all_temperature_stat(), foedus::storage::array::ArrayStoragePimpl::hcc_reset_all_temperature_stat_intermediate(), foedus::storage::hash::HashStoragePimpl::hcc_reset_all_temperature_stat_intermediate(), foedus::storage::masstree::MasstreeStoragePimpl::hcc_reset_all_temperature_stat_recurse(), foedus::storage::hash::ComposedBinsMergedStream::init(), foedus::storage::StorageControlBlock::initialize(), foedus::storage::masstree::MasstreeBorderPage::initialize_as_layer_root_physical(), foedus::storage::StorageManagerPimpl::initialize_read_latest_snapshot(), foedus::storage::sequential::SequentialPage::initialize_snapshot_page(), foedus::storage::sequential::SequentialPage::initialize_volatile_page(), is_both_null(), foedus::storage::array::ArrayStoragePimpl::load(), foedus::storage::array::ArrayStoragePimpl::load_empty(), foedus::storage::masstree::MasstreeStoragePimpl::load_empty(), foedus::storage::hash::HashStoragePimpl::locate_bin(), foedus::storage::hash::HashStoragePimpl::locate_record(), foedus::storage::hash::HashStoragePimpl::locate_record_in_snapshot(), foedus::storage::operator<<(), operator==(), foedus::storage::masstree::MasstreeStoragePimpl::peek_volatile_page_boundaries(), foedus::storage::masstree::MasstreeStoragePimpl::peek_volatile_page_boundaries_next_layer(), foedus::storage::masstree::MasstreeStoragePimpl::peek_volatile_page_boundaries_this_layer_recurse(), foedus::thread::ThreadPimpl::place_a_new_volatile_page(), foedus::storage::masstree::MasstreeStoragePimpl::prefetch_pages_follow(), foedus::storage::array::ArrayStoragePimpl::prefetch_pages_recurse(), foedus::storage::hash::ComposedBinsMergedStream::process_a_bin(), foedus::storage::StorageManagerPimpl::reinitialize_for_recovered_snapshot(), foedus::storage::hash::HashIntermediatePage::release_pages_recursive(), foedus::storage::hash::HashDataPage::release_pages_recursive(), foedus::storage::array::ArrayStoragePimpl::release_pages_recursive(), foedus::storage::masstree::MasstreeIntermediatePage::release_pages_recursive(), foedus::storage::masstree::MasstreeBorderPage::release_pages_recursive(), foedus::storage::hash::HashIntermediatePage::release_pages_recursive_parallel(), foedus::storage::masstree::MasstreeIntermediatePage::release_pages_recursive_parallel(), foedus::storage::masstree::MasstreeBorderPage::replace_next_layer_snapshot(), foedus::storage::masstree::GrowFirstLayerRoot::run(), foedus::storage::masstree::GrowNonFirstLayerRoot::run(), foedus::storage::masstree::ReserveRecords::run(), foedus::storage::hash::ReserveRecords::search_within_page(), foedus::storage::masstree::MasstreeBorderPage::track_moved_record_next_layer(), foedus::storage::hash::HashStoragePimpl::track_moved_record_search(), foedus::storage::array::ArrayStoragePimpl::verify_single_thread(), and foedus::storage::hash::HashStoragePimpl::verify_single_thread_intermediate().