tlds
Transactional Operations for Linked Data Structures
|
#include <txthread.hpp>
Static Public Member Functions | |
static void | thread_shutdown () |
static void | thread_init () |
Public Attributes | |
uint32_t | id |
uint32_t | nesting_depth |
WBMMPolicy | allocator |
uint32_t | num_commits |
uint32_t | num_aborts |
uint32_t | num_restarts |
uint32_t | num_ro |
scope_t *volatile | scope |
uintptr_t | start_time |
uintptr_t | end_time |
uintptr_t | ts_cache |
bool | tmlHasLock |
UndoLog | undo_log |
ValueList | vlist |
WriteSet | writes |
OrecList | r_orecs |
OrecList | locks |
id_version_t | my_lock |
filter_t * | wf |
filter_t * | rf |
volatile uint32_t | prio |
uint32_t | consec_aborts |
uint32_t | seed |
RRecList | myRRecs |
intptr_t | order |
volatile uint32_t | alive |
ByteLockList | r_bytelocks |
ByteLockList | w_bytelocks |
BitLockList | r_bitlocks |
BitLockList | w_bitlocks |
mcs_qnode_t * | my_mcslock |
uintptr_t | valid_ts |
uintptr_t | cm_ts |
filter_t * | cf |
NanorecList | nanorecs |
uint32_t | consec_commits |
toxic_t | abort_hist |
uint32_t | begin_wait |
bool | strong_HG |
bool | irrevocable |
uint64_t | end_txn_time |
uint64_t | total_nontxn_time |
TM_FASTCALL void(* | tmcommit )(STM_COMMIT_SIG(,)) |
TM_FASTCALL void *(* | tmread )(STM_READ_SIG(,,)) |
TM_FASTCALL void(* | tmwrite )(STM_WRITE_SIG(,,,)) |
Static Public Attributes | |
static TM_FASTCALL bool(*volatile | tmbegin )(TxThread *) = begin_CGL |
static scope_t *(* | tmrollback )(STM_ROLLBACK_SIG(,,,)) |
static NORETURN void(* | tmabort )(TxThread *) |
static bool(* | tmirrevoc )(STM_IRREVOC_SIG(,)) = NULL |
Protected Member Functions | |
TxThread () | |
~TxThread () | |
The TxThread struct holds all of the metadata that a thread needs in order to use any of the STM algorithms we support. In the past, this class also had all global STM metadata as static fields, and had lots of methods to support the various STM implementations. This proved to be too cumbersome for some compilers, so we now use this simpler interface. This file can be included in application code without pulling in an obscene amount of STM-related function definitions.
Unfortunately, we still have to pull in metadata.hpp :(
NB: the order of fields has not been rigorously studied. It is very likely that a better order would improve performance.
|
protected |
Constructor sets up the lists and vars
|
inlineprotected |
|
static |
the init factory. Construction of TxThread objects is only possible through this function. Note, too, that destruction is forbidden.
|
inlinestatic |
for shutting down threads. Currently a no-op.
toxic_t stm::TxThread::abort_hist |
volatile uint32_t stm::TxThread::alive |
WBMMPolicy stm::TxThread::allocator |
uint32_t stm::TxThread::begin_wait |
filter_t* stm::TxThread::cf |
uintptr_t stm::TxThread::cm_ts |
uint32_t stm::TxThread::consec_aborts |
uint32_t stm::TxThread::consec_commits |
uintptr_t stm::TxThread::end_time |
uint64_t stm::TxThread::end_txn_time |
uint32_t stm::TxThread::id |
bool stm::TxThread::irrevocable |
OrecList stm::TxThread::locks |
id_version_t stm::TxThread::my_lock |
mcs_qnode_t* stm::TxThread::my_mcslock |
RRecList stm::TxThread::myRRecs |
NanorecList stm::TxThread::nanorecs |
uint32_t stm::TxThread::nesting_depth |
uint32_t stm::TxThread::num_aborts |
uint32_t stm::TxThread::num_commits |
uint32_t stm::TxThread::num_restarts |
uint32_t stm::TxThread::num_ro |
intptr_t stm::TxThread::order |
volatile uint32_t stm::TxThread::prio |
BitLockList stm::TxThread::r_bitlocks |
ByteLockList stm::TxThread::r_bytelocks |
OrecList stm::TxThread::r_orecs |
filter_t* stm::TxThread::rf |
scope_t* volatile stm::TxThread::scope |
uint32_t stm::TxThread::seed |
uintptr_t stm::TxThread::start_time |
bool stm::TxThread::strong_HG |
The function for aborting a transaction. The "tmabort" function is designed as a configurable function pointer so that an API environment like the itm shim can override the conflict abort behavior of the system. tmabort is configured using sys_init.
Some advanced APIs may not want a NORETURN abort function, but the stm library at the moment only handles this option.
|
static |
The read/write/commit instrumentation is reached via per-thread function pointers, which can be exchanged easily during execution.
The begin function is not a per-thread pointer, and thus we can use it for synchronization. This necessitates it being volatile.
The other function pointers can be overwritten by remote threads, but that the synchronization when using the begin() function avoids the need for those pointers to be volatile. The global pointer for starting transactions. The return value should be true if the transaction was started as irrevocable, the caller can use this return to execute completely uninstrumented code if it's available.
The begin function pointer. Note that we need tmbegin to equal begin_cgl initially, since "0" is the default algorithm
TM_FASTCALL void(* stm::TxThread::tmcommit)(STM_COMMIT_SIG(,)) |
|
static |
bool stm::TxThread::tmlHasLock |
TM_FASTCALL void*(* stm::TxThread::tmread)(STM_READ_SIG(,,)) |
|
static |
Some APIs, in particular the itm API at the moment, want to be able to rollback the top level of nesting without actually unwinding the stack. Rollback behavior changes per-implementation (some, such as CGL, can't rollback) so we add it here.
The tmrollback, tmabort, and tmirrevoc pointers
TM_FASTCALL void(* stm::TxThread::tmwrite)(STM_WRITE_SIG(,,,)) |
uint64_t stm::TxThread::total_nontxn_time |
uintptr_t stm::TxThread::ts_cache |
UndoLog stm::TxThread::undo_log |
uintptr_t stm::TxThread::valid_ts |
ValueList stm::TxThread::vlist |
BitLockList stm::TxThread::w_bitlocks |
ByteLockList stm::TxThread::w_bytelocks |
filter_t* stm::TxThread::wf |
WriteSet stm::TxThread::writes |