libfoedus-core
FOEDUS Core Library
|
Shared data of ThreadPimpl. More...
Shared data of ThreadPimpl.
Definition at line 48 of file thread_pimpl.hpp.
#include <thread_pimpl.hpp>
Public Member Functions | |
ThreadControlBlock ()=delete | |
~ThreadControlBlock ()=delete | |
void | initialize (ThreadId my_thread_id) |
void | uninitialize () |
Public Attributes | |
uint32_t | mcs_block_current_ |
How many MCS blocks we allocated in this thread's current xct. More... | |
uint32_t | mcs_rw_async_mapping_current_ |
How many async mappings for extended RW lock we have so far. More... | |
std::atomic< bool > | mcs_waiting_ |
Whether this thread is waiting for some MCS lock. More... | |
soc::SharedPolling | wakeup_cond_ |
The thread sleeps on this conditional when it has no task. More... | |
ThreadStatus | status_ |
Impersonation status of this thread. More... | |
soc::SharedMutex | task_mutex_ |
The following variables are protected by this mutex. More... | |
ThreadTicket | current_ticket_ |
The most recently issued impersonation ticket. More... | |
proc::ProcName | proc_name_ |
Name of the procedure to execute next. More... | |
uint32_t | input_len_ |
Byte size of input given to the procedure. More... | |
uint32_t | output_len_ |
Byte size of output as the result of the procedure. More... | |
FixedErrorStack | proc_result_ |
Error code as the result of the procedure. More... | |
soc::SharedPolling | task_complete_cond_ |
When the current task has been completed, the thread signals this. More... | |
Epoch | in_commit_epoch_ |
ThreadId | my_thread_id_ |
Used only for sanity check. More... | |
uint64_t | stat_snapshot_cache_hits_ |
uint64_t | stat_snapshot_cache_misses_ |
|
delete |
|
delete |
|
inline |
Definition at line 53 of file thread_pimpl.hpp.
References foedus::FixedErrorStack::clear(), foedus::assorted::FixedString< MAXLEN, CHAR >::clear(), current_ticket_, in_commit_epoch_, foedus::soc::SharedMutex::initialize(), foedus::soc::SharedPolling::initialize(), input_len_, foedus::INVALID_EPOCH, foedus::thread::kNotInitialized, mcs_block_current_, mcs_rw_async_mapping_current_, mcs_waiting_, my_thread_id_, output_len_, proc_name_, proc_result_, stat_snapshot_cache_hits_, stat_snapshot_cache_misses_, status_, task_complete_cond_, task_mutex_, and wakeup_cond_.
Referenced by foedus::thread::ThreadPimpl::initialize_once().
|
inline |
Definition at line 71 of file thread_pimpl.hpp.
References task_mutex_, and foedus::soc::SharedMutex::uninitialize().
Referenced by foedus::thread::ThreadPimpl::uninitialize_once().
ThreadTicket foedus::thread::ThreadControlBlock::current_ticket_ |
The most recently issued impersonation ticket.
A session with this ticket has an exclusive ownership until it changes the status_ to kWaitingForTask.
Definition at line 120 of file thread_pimpl.hpp.
Referenced by foedus::thread::ImpersonateSession::get_result(), initialize(), foedus::thread::ImpersonateSession::is_running(), foedus::thread::ImpersonateSession::release(), and foedus::thread::ThreadRef::try_impersonate().
Epoch foedus::thread::ThreadControlBlock::in_commit_epoch_ |
Definition at line 140 of file thread_pimpl.hpp.
Referenced by foedus::thread::ThreadRef::get_in_commit_epoch(), foedus::thread::Thread::get_in_commit_epoch_address(), and initialize().
uint32_t foedus::thread::ThreadControlBlock::input_len_ |
Byte size of input given to the procedure.
Definition at line 126 of file thread_pimpl.hpp.
Referenced by initialize(), and foedus::thread::ThreadRef::try_impersonate().
uint32_t foedus::thread::ThreadControlBlock::mcs_block_current_ |
How many MCS blocks we allocated in this thread's current xct.
reset to 0 at each transaction begin. This is in shared memory because other SOC might check this value (so far only for sanity check).
Definition at line 84 of file thread_pimpl.hpp.
Referenced by foedus::thread::ThreadPimplMcsAdaptor< RW_BLOCK >::cancel_new_block(), foedus::thread::ThreadPimplMcsAdaptor< RW_BLOCK >::get_cur_block(), foedus::thread::ThreadPimplMcsAdaptor< RW_BLOCK >::get_other_cur_block(), foedus::thread::ThreadPimplMcsAdaptor< RW_BLOCK >::get_rw_other_block(), foedus::thread::ThreadPimplMcsAdaptor< RW_BLOCK >::get_ww_other_block(), initialize(), foedus::thread::ThreadPimpl::initialize_once(), and foedus::thread::ThreadPimplMcsAdaptor< RW_BLOCK >::issue_new_block().
uint32_t foedus::thread::ThreadControlBlock::mcs_rw_async_mapping_current_ |
How many async mappings for extended RW lock we have so far.
Definition at line 87 of file thread_pimpl.hpp.
Referenced by foedus::thread::ThreadPimplMcsAdaptor< RW_BLOCK >::add_rw_async_mapping(), foedus::thread::ThreadRef::get_mcs_rw_async_mapping(), initialize(), foedus::thread::ThreadPimpl::initialize_once(), and foedus::thread::ThreadPimplMcsAdaptor< RW_BLOCK >::remove_rw_async_mapping().
std::atomic<bool> foedus::thread::ThreadControlBlock::mcs_waiting_ |
Whether this thread is waiting for some MCS lock.
While this is true, the thread spins on this local variable. The lock owner updates this when it unlocks. We initially had this flag within each MCS lock node, but we anyway assume one thread can wait for at most one lock. So, we moved it to a flag in control block.
Definition at line 97 of file thread_pimpl.hpp.
Referenced by initialize(), foedus::thread::ThreadPimplMcsAdaptor< RW_BLOCK >::me_waiting(), and foedus::thread::ThreadPimplMcsAdaptor< RW_BLOCK >::other_waiting().
ThreadId foedus::thread::ThreadControlBlock::my_thread_id_ |
Used only for sanity check.
This thread's ID.
Definition at line 143 of file thread_pimpl.hpp.
Referenced by initialize().
uint32_t foedus::thread::ThreadControlBlock::output_len_ |
Byte size of output as the result of the procedure.
Definition at line 129 of file thread_pimpl.hpp.
Referenced by foedus::thread::ImpersonateSession::get_output_size(), and initialize().
proc::ProcName foedus::thread::ThreadControlBlock::proc_name_ |
Name of the procedure to execute next.
Empty means not set.
Definition at line 123 of file thread_pimpl.hpp.
Referenced by initialize(), and foedus::thread::ThreadRef::try_impersonate().
FixedErrorStack foedus::thread::ThreadControlBlock::proc_result_ |
Error code as the result of the procedure.
Definition at line 132 of file thread_pimpl.hpp.
Referenced by foedus::thread::ImpersonateSession::get_result(), and initialize().
uint64_t foedus::thread::ThreadControlBlock::stat_snapshot_cache_hits_ |
Definition at line 145 of file thread_pimpl.hpp.
Referenced by foedus::thread::ThreadPimpl::find_or_read_a_snapshot_page(), foedus::thread::ThreadPimpl::find_or_read_snapshot_pages_batch(), foedus::thread::ThreadRef::get_snapshot_cache_hits(), foedus::thread::Thread::get_snapshot_cache_hits(), initialize(), foedus::thread::ThreadRef::reset_snapshot_cache_counts(), and foedus::thread::Thread::reset_snapshot_cache_counts().
uint64_t foedus::thread::ThreadControlBlock::stat_snapshot_cache_misses_ |
Definition at line 146 of file thread_pimpl.hpp.
Referenced by foedus::thread::ThreadPimpl::find_or_read_a_snapshot_page(), foedus::thread::ThreadPimpl::find_or_read_snapshot_pages_batch(), foedus::thread::ThreadRef::get_snapshot_cache_misses(), foedus::thread::Thread::get_snapshot_cache_misses(), initialize(), foedus::thread::ThreadRef::reset_snapshot_cache_counts(), and foedus::thread::Thread::reset_snapshot_cache_counts().
ThreadStatus foedus::thread::ThreadControlBlock::status_ |
Impersonation status of this thread.
Protected by the mutex in wakeup_cond_, not the task_mutex_ below. Use the right mutex. Otherwise a lost signal is possible.
Definition at line 110 of file thread_pimpl.hpp.
Referenced by foedus::thread::ImpersonateSession::get_result(), initialize(), foedus::thread::ImpersonateSession::is_running(), foedus::thread::ThreadPimpl::is_stop_requested(), foedus::thread::operator<<(), foedus::thread::ImpersonateSession::release(), foedus::thread::ThreadRef::try_impersonate(), and foedus::thread::ThreadPimpl::uninitialize_once().
soc::SharedPolling foedus::thread::ThreadControlBlock::task_complete_cond_ |
When the current task has been completed, the thread signals this.
Definition at line 137 of file thread_pimpl.hpp.
Referenced by initialize(), foedus::thread::ImpersonateSession::wait(), and foedus::thread::ImpersonateSession::wait_for().
soc::SharedMutex foedus::thread::ThreadControlBlock::task_mutex_ |
The following variables are protected by this mutex.
Definition at line 113 of file thread_pimpl.hpp.
Referenced by initialize(), foedus::thread::ThreadRef::try_impersonate(), and uninitialize().
soc::SharedPolling foedus::thread::ThreadControlBlock::wakeup_cond_ |
The thread sleeps on this conditional when it has no task.
When someone else (whether in same SOC or other SOC) wants to wake up this logger, they fire this. The 'real' condition variable is the status_.
Definition at line 104 of file thread_pimpl.hpp.
Referenced by initialize(), foedus::thread::ThreadRef::try_impersonate(), and foedus::thread::ThreadPimpl::uninitialize_once().