libfoedus-core
FOEDUS Core Library
foedus::soc::ChildEngineStatus Struct Referencefinal

Current status of a child SOC engine. More...

Detailed Description

Current status of a child SOC engine.

This object is placed in shared memory, so this must not have a heap-allocated member.

Definition at line 142 of file shared_memory_repo.hpp.

#include <shared_memory_repo.hpp>

Public Types

enum  StatusCode {
  kInitial = 0, kSharedMemoryAttached, kWaitingForMasterInitialization, kRunning,
  kTerminated, kFatalError
}
 These statuses represent each step described in SocManager comment. More...
 

Public Member Functions

 ChildEngineStatus ()=delete
 
 ~ChildEngineStatus ()=delete
 
 ChildEngineStatus (const ChildEngineStatus &other)=delete
 
ChildEngineStatusoperator= (const ChildEngineStatus &other)=delete
 
void change_status_atomic (StatusCode new_status)
 Update the value of status_code_ with fence. More...
 
StatusCode read_status_atomic () const
 Read status_code_ with fence. More...
 
void change_init_atomic (ModuleType value)
 
void change_uninit_atomic (ModuleType value)
 

Public Attributes

StatusCode status_code_
 
ModuleType initialized_modules_
 The module that has been most recently initialized in this node. More...
 
ModuleType uninitialized_modules_
 The module that has been most recently closed in this node. More...
 

Member Enumeration Documentation

These statuses represent each step described in SocManager comment.

The status always increases one-by-one or jumps to kFatalError.

Enumerator
kInitial 

Child engine has just started.

kSharedMemoryAttached 

Child engine successfully attached shared memory and waiting for master's kWaitingForChildInitialization status.

kWaitingForMasterInitialization 

Child engine has successfully initialized all modules and is now waiting for master's kRunning status.

kRunning 

Done all initialization and running transactions.

kTerminated 

The child engine has normally terminated.

This is a final status.

kFatalError 

The child engine observed some unrecoverable error and has exit.

This is a final status.

Definition at line 147 of file shared_memory_repo.hpp.

147  {
151  kInitial = 0,
162 
164  kRunning,
165 
167  kTerminated,
169  kFatalError,
170  };
Child engine successfully attached shared memory and waiting for master's kWaitingForChildInitializat...
The child engine has normally terminated.
Child engine has successfully initialized all modules and is now waiting for master's kRunning status...
Done all initialization and running transactions.
The child engine observed some unrecoverable error and has exit.

Constructor & Destructor Documentation

foedus::soc::ChildEngineStatus::ChildEngineStatus ( )
delete
foedus::soc::ChildEngineStatus::~ChildEngineStatus ( )
delete
foedus::soc::ChildEngineStatus::ChildEngineStatus ( const ChildEngineStatus other)
delete

Member Function Documentation

void foedus::soc::ChildEngineStatus::change_init_atomic ( ModuleType  value)
inline

Definition at line 192 of file shared_memory_repo.hpp.

References ASSERT_ND, initialized_modules_, and foedus::assorted::memory_fence_acq_rel().

Referenced by foedus::EnginePimpl::on_module_initialized().

192  {
193  ASSERT_ND(static_cast<int>(initialized_modules_) == static_cast<int>(value) - 1);
195  initialized_modules_ = value;
197  }
ModuleType initialized_modules_
The module that has been most recently initialized in this node.
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72
void memory_fence_acq_rel()
Equivalent to std::atomic_thread_fence(std::memory_order_acq_rel).

Here is the call graph for this function:

Here is the caller graph for this function:

void foedus::soc::ChildEngineStatus::change_status_atomic ( StatusCode  new_status)
inline

Update the value of status_code_ with fence.

Definition at line 179 of file shared_memory_repo.hpp.

References ASSERT_ND, kFatalError, foedus::assorted::memory_fence_acq_rel(), and status_code_.

Referenced by foedus::soc::SharedMemoryRepo::change_child_status(), and foedus::soc::SocManagerPimpl::report_engine_fatal_error().

179  {
180  ASSERT_ND(new_status == kFatalError ||
181  static_cast<int>(new_status) == static_cast<int>(status_code_) + 1);
183  status_code_ = new_status;
185  }
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72
The child engine observed some unrecoverable error and has exit.
void memory_fence_acq_rel()
Equivalent to std::atomic_thread_fence(std::memory_order_acq_rel).

Here is the call graph for this function:

Here is the caller graph for this function:

void foedus::soc::ChildEngineStatus::change_uninit_atomic ( ModuleType  value)
inline

Definition at line 198 of file shared_memory_repo.hpp.

References ASSERT_ND, foedus::assorted::memory_fence_acq_rel(), and uninitialized_modules_.

Referenced by foedus::EnginePimpl::on_module_uninitialized().

198  {
199  ASSERT_ND(static_cast<int>(uninitialized_modules_) == static_cast<int>(value) + 1);
201  uninitialized_modules_ = value;
203  }
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72
ModuleType uninitialized_modules_
The module that has been most recently closed in this node.
void memory_fence_acq_rel()
Equivalent to std::atomic_thread_fence(std::memory_order_acq_rel).

Here is the call graph for this function:

Here is the caller graph for this function:

ChildEngineStatus& foedus::soc::ChildEngineStatus::operator= ( const ChildEngineStatus other)
delete
StatusCode foedus::soc::ChildEngineStatus::read_status_atomic ( ) const
inline

Read status_code_ with fence.

Definition at line 187 of file shared_memory_repo.hpp.

References foedus::assorted::memory_fence_acq_rel(), and status_code_.

Referenced by foedus::soc::SharedMemoryRepo::get_child_status().

187  {
189  return status_code_;
190  }
void memory_fence_acq_rel()
Equivalent to std::atomic_thread_fence(std::memory_order_acq_rel).

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

ModuleType foedus::soc::ChildEngineStatus::initialized_modules_

The module that has been most recently initialized in this node.

Used to synchronize init.

Definition at line 207 of file shared_memory_repo.hpp.

Referenced by change_init_atomic(), foedus::soc::SocManagerPimpl::initialize_master(), and foedus::soc::SocManagerPimpl::wait_for_children_module().

ModuleType foedus::soc::ChildEngineStatus::uninitialized_modules_

The module that has been most recently closed in this node.

Used to synchronize uninit.

Definition at line 209 of file shared_memory_repo.hpp.

Referenced by change_uninit_atomic(), foedus::soc::SocManagerPimpl::initialize_master(), and foedus::soc::SocManagerPimpl::wait_for_children_module().


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