libfoedus-core
FOEDUS Core Library
|
Thread and Thread-Group, which abstracts NUMA-core/node and provides API to attach/detach tasks to pooled threads. More...
Thread and Thread-Group, which abstracts NUMA-core/node and provides API to attach/detach tasks to pooled threads.
This package is analogous to std::thread or boost::thread with a few additional features specific to our database engine. Among all, the main difference is that this package is fully aware of NUMA (Non Uniform Memory Access) architecture in hardware.
Classes | |
class | ConditionVariable |
An analogue of pthread's condition variable and std::condition_variable to avoid glibc's bug in pthread_cond_broadcast/signal (thus in notify_all/one in turn). More... | |
class | GrabFreeVolatilePagesScope |
Obtains multiple free volatile pages at once and releases them automatically when this object gets out of scope. More... | |
struct | ImpersonateSession |
A user session running on an impersonated thread. More... | |
struct | NumaThreadScope |
Pin the current thread to the given NUMA node in this object's scope. More... | |
class | Rendezvous |
The frequently appearing triplet of condition_varible, "signal" flag for spurious wakeup, and mutex for a one-time single-producer multiple-consumer event synchronization. More... | |
class | StoppableThread |
The frequently appearing quartet of std::thread, condition_varible, stop-request flag, and mutex. More... | |
class | Thread |
Represents one thread running on one NUMA core. More... | |
struct | ThreadControlBlock |
Shared data of ThreadPimpl. More... | |
class | ThreadGroup |
Represents a group of pre-allocated threads running in one NUMA node. More... | |
class | ThreadGroupRef |
A view of Thread group object for other SOCs and master engine. More... | |
struct | ThreadOptions |
Set of options about threads and thread-groups. More... | |
class | ThreadPimpl |
Pimpl object of Thread. More... | |
struct | ThreadPimplCllReleaseAllFunctor |
class | ThreadPimplMcsAdaptor |
Implements McsAdaptorConcept over ThreadPimpl. More... | |
class | ThreadPool |
The pool of pre-allocated threads in the engine to execute transactions. More... | |
class | ThreadPoolPimpl |
Pimpl object of ThreadPool. More... | |
class | ThreadRef |
A view of Thread object for other SOCs and master engine. More... | |
Typedefs | |
typedef uint8_t | ThreadGroupId |
Typedef for an ID of ThreadGroup (NUMA node). More... | |
typedef uint8_t | ThreadLocalOrdinal |
Typedef for a local ID of Thread (core), which is NOT unique across NUMA nodes. More... | |
typedef uint16_t | ThreadId |
Typedef for a global ID of Thread (core), which is unique across NUMA nodes. More... | |
typedef uint16_t | ThreadGlobalOrdinal |
Typedef for a globally and contiguously numbered ID of thread. More... | |
typedef uint64_t | ThreadTicket |
Typedef for a monotonically increasing ticket for thread impersonation. More... | |
typedef int64_t | TimeoutMicrosec |
Used as a general timeout parameter (in microseconds) for synchronous methods. More... | |
Enumerations | |
enum | ThreadPolicy { kScheduleOther = 0, kScheduleFifo = 1, kScheduleRr = 2, kScheduleBatch = 3, kScheduleIdle = 5 } |
Thread policy for worker threads. More... | |
enum | ThreadPriority { kPriorityIdle = 0, kPriorityLowest = 1, kPriorityDefault = 50, kPriorityHighest = 99 } |
Thread priority for worker threads. More... | |
enum | ThreadStatus { kNotInitialized = 0, kWaitingForTask, kWaitingForExecution, kRunningTask, kWaitingForClientRelease, kWaitingForTerminate, kTerminated } |
Impersonation status of each worker thread. More... | |
Functions | |
ThreadId | compose_thread_id (ThreadGroupId node, ThreadLocalOrdinal local_core) |
Returns a globally unique ID of Thread (core) for the given node and ordinal in the node. More... | |
ThreadGroupId | decompose_numa_node (ThreadId global_id) |
Extracts NUMA node ID from the given globally unique ID of Thread (core). More... | |
ThreadLocalOrdinal | decompose_numa_local_ordinal (ThreadId global_id) |
Extracts local ordinal from the given globally unique ID of Thread (core). More... | |
ThreadGlobalOrdinal | to_global_ordinal (ThreadId thread_id, uint8_t threads_per_nodes) |
Calculate ThreadGlobalOrdinal from ThreadId. More... | |
std::ostream & | operator<< (std::ostream &o, const ImpersonateSession &v) |
std::ostream & | operator<< (std::ostream &o, const StoppableThread &v) |
std::ostream & | operator<< (std::ostream &o, const Thread &v) |
std::ostream & | operator<< (std::ostream &o, const ThreadGroup &v) |
void | assert_mcs_aligned (const void *address) |
ThreadPimpl MCS implementations. More... | |
template<typename RW_BLOCK > | |
xct::McsImpl< ThreadPimplMcsAdaptor< RW_BLOCK >, RW_BLOCK > | get_mcs_impl (ThreadPimpl *pimpl) |
std::ostream & | operator<< (std::ostream &o, const ThreadPool &v) |
std::ostream & | operator<< (std::ostream &o, const ThreadPoolPimpl &v) |
std::ostream & | operator<< (std::ostream &o, const ThreadGroupRef &v) |
std::ostream & | operator<< (std::ostream &o, const ThreadRef &v) |
Variables | |
const ThreadGroupId | kMaxThreadGroupId = 0xFF |
Maximum possible value of ThreadGroupId. More... | |
const ThreadLocalOrdinal | kMaxThreadLocalOrdinal = 0xFF |
Maximum possible value of ThreadLocalOrdinal. More... | |
const ThreadId | kMaxThreadId = 0xFFFF |
Maximum possible value of ThreadId. More... | |
typedef int64_t foedus::thread::TimeoutMicrosec |
Used as a general timeout parameter (in microseconds) for synchronous methods.
If the method had to wait for this length, it gives up and returns a failure. Negative value means forever. 0 means no wait, in other words it's conditional (we execute the function on the condition of immediate availability).
Definition at line 159 of file thread_id.hpp.
|
inline |
ThreadPimpl MCS implementations.
Definition at line 859 of file thread_pimpl.cpp.
References ASSERT_ND.
xct::McsImpl< ThreadPimplMcsAdaptor< RW_BLOCK >, RW_BLOCK > foedus::thread::get_mcs_impl | ( | ThreadPimpl * | pimpl | ) |
Definition at line 865 of file thread_pimpl.cpp.
std::ostream& foedus::thread::operator<< | ( | std::ostream & | o, |
const ThreadGroup & | v | ||
) |
Definition at line 57 of file thread_group.cpp.
std::ostream& foedus::thread::operator<< | ( | std::ostream & | o, |
const ThreadPool & | v | ||
) |
Definition at line 75 of file thread_pool.cpp.
std::ostream& foedus::thread::operator<< | ( | std::ostream & | o, |
const StoppableThread & | v | ||
) |
Definition at line 93 of file stoppable_thread_impl.cpp.
std::ostream& foedus::thread::operator<< | ( | std::ostream & | o, |
const Thread & | v | ||
) |
Definition at line 118 of file thread.cpp.
References foedus::thread::ThreadPimpl::control_block_, foedus::thread::Thread::get_thread_global_ordinal(), foedus::thread::Thread::get_thread_id(), and foedus::thread::ThreadControlBlock::status_.
std::ostream& foedus::thread::operator<< | ( | std::ostream & | o, |
const ThreadPoolPimpl & | v | ||
) |
Definition at line 121 of file thread_pool_pimpl.cpp.
References foedus::thread::ThreadPoolPimpl::groups_.
std::ostream& foedus::thread::operator<< | ( | std::ostream & | o, |
const ImpersonateSession & | v | ||
) |
Definition at line 130 of file impersonate_session.cpp.
References foedus::thread::ThreadRef::get_thread_id(), foedus::thread::ImpersonateSession::is_valid(), and foedus::thread::ImpersonateSession::thread_.
std::ostream& foedus::thread::operator<< | ( | std::ostream & | o, |
const ThreadGroupRef & | v | ||
) |
Definition at line 160 of file thread_ref.cpp.
References foedus::thread::ThreadGroupRef::get_group_id().
std::ostream& foedus::thread::operator<< | ( | std::ostream & | o, |
const ThreadRef & | v | ||
) |
Definition at line 172 of file thread_ref.cpp.
References foedus::thread::ThreadRef::get_control_block(), foedus::thread::ThreadRef::get_thread_id(), and foedus::thread::ThreadControlBlock::status_.