libfoedus-core
FOEDUS Core Library
foedus::xct::XctManagerControlBlock Struct Reference

Shared data in XctManagerPimpl. More...

Detailed Description

Shared data in XctManagerPimpl.

Definition at line 39 of file xct_manager_pimpl.hpp.

#include <xct_manager_pimpl.hpp>

Collaboration diagram for foedus::xct::XctManagerControlBlock:

Public Member Functions

 XctManagerControlBlock ()=delete
 
 ~XctManagerControlBlock ()=delete
 
void initialize ()
 
void uninitialize ()
 

Public Attributes

std::atomic< Epoch::EpochIntegercurrent_global_epoch_
 The current epoch of the entire engine. More...
 
std::atomic< Epoch::EpochIntegerrequested_global_epoch_
 If some thread requested to immediately advance epoch, the requested epoch. More...
 
soc::SharedPolling current_global_epoch_advanced_
 Fired (broadcast) whenever current_global_epoch_ is advanced. More...
 
soc::SharedPolling epoch_chime_wakeup_
 Fired to wakeup epoch_chime_thread_. More...
 
std::atomic< bool > epoch_chime_terminate_requested_
 Protected by the mutex in epoch_chime_wakeup_. More...
 
std::atomic< bool > new_transaction_paused_
 If true, all new requests to begin_xct() will be paused until this becomes false. More...
 

Constructor & Destructor Documentation

foedus::xct::XctManagerControlBlock::XctManagerControlBlock ( )
delete
foedus::xct::XctManagerControlBlock::~XctManagerControlBlock ( )
delete

Member Function Documentation

void foedus::xct::XctManagerControlBlock::initialize ( )
inline

Definition at line 44 of file xct_manager_pimpl.hpp.

References current_global_epoch_advanced_, epoch_chime_wakeup_, foedus::soc::SharedPolling::initialize(), and new_transaction_paused_.

Referenced by foedus::xct::XctManagerPimpl::initialize_once().

44  {
48  }
soc::SharedPolling epoch_chime_wakeup_
Fired to wakeup epoch_chime_thread_.
std::atomic< bool > new_transaction_paused_
If true, all new requests to begin_xct() will be paused until this becomes false. ...
soc::SharedPolling current_global_epoch_advanced_
Fired (broadcast) whenever current_global_epoch_ is advanced.

Here is the call graph for this function:

Here is the caller graph for this function:

void foedus::xct::XctManagerControlBlock::uninitialize ( )
inline

Definition at line 49 of file xct_manager_pimpl.hpp.

Referenced by foedus::xct::XctManagerPimpl::uninitialize_once().

49  {
50  }

Here is the caller graph for this function:

Member Data Documentation

std::atomic<Epoch::EpochInteger> foedus::xct::XctManagerControlBlock::current_global_epoch_

The current epoch of the entire engine.

Currently running (committing) transactions will use this value as their serialization point. No locks to protect this variable, but

  • There should be only one thread that might update this (XctManager).
  • Readers should take appropriate fence before reading this.
    Invariant
    current_global_epoch_ > 0 (current_global_epoch_ begins with 1, not 0. So, epoch-0 is always an empty/dummy epoch)

Definition at line 62 of file xct_manager_pimpl.hpp.

Referenced by foedus::xct::XctManagerPimpl::get_current_global_epoch(), foedus::xct::XctManagerPimpl::get_current_global_epoch_weak(), foedus::xct::XctManagerPimpl::handle_epoch_chime(), and foedus::xct::XctManagerPimpl::initialize_once().

soc::SharedPolling foedus::xct::XctManagerControlBlock::current_global_epoch_advanced_
std::atomic<bool> foedus::xct::XctManagerControlBlock::epoch_chime_terminate_requested_
soc::SharedPolling foedus::xct::XctManagerControlBlock::epoch_chime_wakeup_
std::atomic<bool> foedus::xct::XctManagerControlBlock::new_transaction_paused_

If true, all new requests to begin_xct() will be paused until this becomes false.

This is the mechanism for very rare events that need to separate out all concurrent transaction executions, such as drop-volatile-page step after snapshotting. This does not affect an already running transaction, so the snapshot thread must wait for long enough after setting this value. Also, the worker threads simply check-with-sleep to wait until this becomes false, not SharedCond. This is used only once per several minutes, so no need for optimization. Keep it simple!

Definition at line 90 of file xct_manager_pimpl.hpp.

Referenced by foedus::xct::XctManagerPimpl::begin_xct(), initialize(), foedus::xct::XctManagerPimpl::pause_accepting_xct(), foedus::xct::XctManagerPimpl::resume_accepting_xct(), and foedus::xct::XctManagerPimpl::wait_until_resume_accepting_xct().

std::atomic<Epoch::EpochInteger> foedus::xct::XctManagerControlBlock::requested_global_epoch_

If some thread requested to immediately advance epoch, the requested epoch.

If this is less than or equal to current_global_epoch_, there is no immediate advance request.

Invariant
requested_global_epoch_.is_valid()

Definition at line 69 of file xct_manager_pimpl.hpp.

Referenced by foedus::xct::XctManagerPimpl::get_requested_global_epoch(), foedus::xct::XctManagerPimpl::initialize_once(), and foedus::xct::XctManagerPimpl::set_requested_global_epoch().


The documentation for this struct was generated from the following file: