libfoedus-core
FOEDUS Core Library
|
Automatically sets in-commit-epoch with appropriate fence during pre-commit protocol. More...
Automatically sets in-commit-epoch with appropriate fence during pre-commit protocol.
If a transaction is currently committing with some log to publish, in-commit epoch gives the conservative estimate (although usually exact) of the commit epoch.
This class guards the range from a read-write transaction starts committing until it publishes or discards the logs.
This is used by the epoch chime to tell if it can assume that this transaction already got a new epoch or not in commit phase. If it's not the case, the chime will spin on this until this returns 0 or epoch that is enough recent. Without this mechanisim, we will get a too conservative value of "min(ctid_w)" (Sec 4.10 [TU2013]) when there are some threads that are either idle or spending long time before/after commit.
The transaction takes an appropriate fence before updating this value so that followings are guaranteed:
Definition at line 58 of file in_commit_epoch_guard.hpp.
#include <in_commit_epoch_guard.hpp>
Public Member Functions | |
InCommitEpochGuard (Epoch *in_commit_epoch_address, Epoch conservative_epoch) | |
~InCommitEpochGuard () | |
Public Attributes | |
Epoch *const | in_commit_epoch_address_ |
|
inline |
Definition at line 59 of file in_commit_epoch_guard.hpp.
References ASSERT_ND, in_commit_epoch_address_, and foedus::INVALID_EPOCH.
|
inline |
Definition at line 67 of file in_commit_epoch_guard.hpp.
References in_commit_epoch_address_, foedus::INVALID_EPOCH, and foedus::assorted::memory_fence_release().
Epoch* const foedus::xct::InCommitEpochGuard::in_commit_epoch_address_ |
Definition at line 80 of file in_commit_epoch_guard.hpp.
Referenced by InCommitEpochGuard(), and ~InCommitEpochGuard().