#include <setjmp.h>
#include <cstdlib>
#include <cassert>
#include <api/library.hpp>
Go to the source code of this file.
Value:{ \
jmp_buf jmpbuf_; \
uint32_t abort_flags = setjmp(jmpbuf_);
\
begin(static_cast<stm::TxThread*>(
STM_SELF), &jmpbuf_, abort_flags);\
CFENCE; \
{
#define STM_SELF
Definition: stamp.hpp:30
TM_INLINE void begin(TxThread *tx, scope_t *s, uint32_t)
Definition: library.hpp:71
The begin and commit instrumentation are straightforward
Value:
}
#define STM_SELF
Definition: stamp.hpp:30
TM_INLINE void commit(TxThread *tx)
Definition: library.hpp:104
#define STM_FREE_THREAD |
( |
|
t | ) |
|
#define STM_LOCAL_WRITE_F |
( |
|
var, |
|
|
|
val |
|
) |
| ({var = val; var;}) |
#define STM_LOCAL_WRITE_I |
( |
|
var, |
|
|
|
val |
|
) |
| ({var = val; var;}) |
#define STM_LOCAL_WRITE_L |
( |
|
var, |
|
|
|
val |
|
) |
| ({var = val; var;}) |
#define STM_LOCAL_WRITE_P |
( |
|
var, |
|
|
|
val |
|
) |
| ({var = val; var;}) |
#define STM_NEW_THREAD |
( |
| ) |
0 |
#define STM_SELF tm_descriptor |
Copyright (C) 2011 University of Rochester Department of Computer Science and Lehigh University Department of Computer Science and Engineering
License: Modified BSD Please see the file LICENSE.RSTM for licensing information We are gradually moving to a state where STAMP will be in pure C++. Clearly we are not there yet, but currently we have STAMP set to build with g++ instead of gcc.
That being the case, we're going to avoid some cruft by mapping MACROs directly to c++ functions, instead of hiding code within an 'extern C' block with C-style wrapper functions.
tm_main_startup()
call before any threads try to run transactions, in order to ensure that the TM library is properly configured.
multiple calls are safe, since the library protects itself
tm_start(desc, id)
STAMP uses this during its main processing loop, once all of the threads have been created and are sitting at a barrier waiting to start. We expect it to be only called once per thread, but it is ok if it is called more than once.
The thread that called tm_main_startup(...) /can/, but does not have to, call this routine.
void* tx_safe_non_tx_alloc |
( |
size_t |
size | ) |
|
|
inline |
Special alloc for STAMP, used to detect nontransactional mallocs from within transactions
void tx_safe_non_tx_free |
( |
void * |
ptr | ) |
|
|
inline |
Special free for STAMP, used to detect nontransactional frees from within transactions