Notes on use of STM library:
- General information
- Configurations
- XL compiler
- Platforms
- Functions
- Statistics
General information:
The software transactional memory (STM) library code provides several
configurations and policies for implementing transactional memory
(TM). A transaction performs a set of reads and writes to shared
memory. The TM system, under certain conditions, guarantees that each
transaction appears as if all of its reads and writes are
performed atomically together in relation to other transactions.
For the current implementation, it is assumed that shared locations
are either always accessed inside transactions or always outside
transactions, and that transactions include only revocable operations
without side effects, and hence can be safely undone and retried.
The STM implementations use metadata to synchronize access to shared
locations accessed transactionally. Each shared location is associated
with a metadata entry. A metadata entry serves as a version number
tracking updates of associated shared locations, and as a lock
protecting updates of these shared locations.
In general, at the beginning of a transaction, the thread sets private
per-thread transactional status data and in some configurations read
some global data. For transactional reads, the thread reads and checks
the metadata corresponding to the target location and then reads the
target location, and in some configurations, checks the consistency of
the read set. For transactional writes, the thread records the target
address and the value to be written, and in some configurations
acquires the corresponding metadata lock. At the end of a transaction,
the thread acquires the metadata locks corresponding to its write set
if not already acquired, validates the consistency of its read set,
writes the values to the addresses in its write set, releases the
metadata locks, and finally resets its private transactional data.
The main design configuration issues are:
- Read set inconsistency may lead to failures such as segmentation
faults, division by zero and infinite loops. Under configurations
that allow read set inconsistency, the STM system attempts to catch
and recover from these failures. However, these attempts are not
guaranteed to catch every possible failure. For example, the STM
library cannot detect and recover from an infinite loop that does
not generate any calls to the STM code. In some cases all possible
failure types that may arise due to inconsistent reads can be
anticipated, and it may be advantageous to forego read set
consistency, in order to avoid the costs of frequent read set
validations that are needed to guarantee read set consistency.
- If read set consistency is to be guaranteed, there are multiple
configurations. One is to check the metadata of each read in the
read set after every read, which leads to a quadratic cost. The
advantage of this choice is that it is scalable, as in general
disjoint transactions do not interfere with each other.
- Another configuration employs a global version number to enable fast
validation without checking each individual metadata entry
corresponding to the reads in the transaction's read set unless a
change in the global version number is detected. However, this
requires each writing transactions to increment the global version
number and hence this may limit concurrency, even among
non-conflicting transactions.
- For programs with transactions with small read sets, the cost of
full validation after every read may not be high, while incrementing
a global version may be expensive relative to the small
transactions and limits concurrency, and thus it may be a better
choice to use full validation.
- For programs with transactions with large read sets, the cost of
updating the global version number may be small relative to the
large transactions, and the low frequency of global version number
updates may not pose significant limitations on concurrency, while
the quadratic cost of full validation after every read can be very
high. Thus, in such cases it may be better to use a configuration
with a global version number.
- Another design issue is when to acquire the metadata locks for the
write set. Acquiring locks at encounter time enables fast
determination for reads whether the location has been written by the
same transaction or not without searching the write set, but
increases the time where locks are held and thus increases the
chances of inter-transaction conflicts. Acquiring locks at the end
of the transaction minimizes the time where locks are held, but
requires other mechanisms for detecting read after write cases using
Bloom filters for fast search of write sets.
Configurations:
The default implementation uses the following policy and configuration
options:
- Consistent read sets
- Global version number
- Write set lock acquisition at the end of the transaction
- 1M metadata data entries
- 8 byte conflict unit
- 512-bit write set Bloom filters
In order to use different policies and configurations, add EXTRA_FLAGS
settings to the make command. For example, to use an encounter-time
acquire policy for transactional writes use the command:
make all EXTRA_FLAGS="-DENCOUNTER_ACQUIRE"
Some of the main configuration flags are:
- NOINC_VALIDATION: To allow inconsistent reads and use signals to
catch failures.
- NOGLOBAL_VERSION: To avoid the use of a global version number.
- ENCOUNTER_ACQUIRE: To acquire metadata locks on encountering
transactional writes instead of at the end of the transaction
- LOG_2_NUM_ORECS=<integer>: Log 2 of the number of metadata
entries. Default 20.
- LOG_2_BLOOM_FILTER_BITS=<integer>: Log 2 of the write set Bloom
filter size. Default 9.
- LOG_2_BLOCKS_SIZE=<integer>: Log 2 of the conflict unit block
size. Default 3.
- MAX_TXNS=<integer>: Maximum number of static transactions in the
programs. Used only for statistics. Default 64.
XL compiler:
The STM implementations support a low-level interface. The IBM XL
C/C++ compiler for Transactional Memory available from IBM AlphaWorks
(http://www.alphaworks.ibm.com/tech/xlcstm/) uses this
interface. Therefore, STM libraries built from this code release can
be linked with user programs using that compiler without need to
instrument individual reads and writes inside transactions. Programs
need to use a high-level interface as specified in
http://www.alphaworks.ibm.com/tech/xlcstm/. Note that the IBM XL C/C++
compiler for Transactional Memory runs on AIX systems only at this
point, while the STM code runs on a variety of systems as noted below.
It is possible for other compilers to use this STM code, if they use
the same low level interface described below.
Platforms:
The STM code runs on several platforms including AIX-PowerPC,
Linux-PowerPC, and Linux-X86, and Linux-X86_64. The code may run on Solaris-SPARC
but it has not been tested.
Functions:
The low-level STM interface is defined in the file stm.h.
The main functions and macros are:
- The macros STM_BEGIN and STM_END are to be used at the beginning and
end of transactions.
- stm_thr_init takes no arguments and returns a pointer to the
thread's private transactional descriptor. This function should be
called once before a thread starts using transactions.
- stm_thr_retire takes no arguments and has no return value. This
function should be called once when a thread is no longer to use
transactions. A thread may call stm_thr_init after it calls
stm_thr_retire in order to resume using transactions.
- stm_desc takes no arguments and returns a pointer to the per-thread
private transactional descriptor that is passed as an argument to
most other STM func
没有合适的资源?快使用搜索试试~ 我知道了~
Amino 框架所有源码
共352个文件
java:120个
h:80个
cpp:36个
需积分: 31 8 下载量 65 浏览量
2017-07-25
10:46:52
上传
评论
收藏 12.02MB ZIP 举报
温馨提示
该组件将提供一套免锁的集合类(LockFreeVector、LockFreeList、LockFreeSet等)、树结构、图结构。因为这些数据结构采用免锁的运算法则来生成,所以,它们将拥有基本的免锁组件的特性,如可以避免不同类型的死锁,不同类型的线程初始化顺序等。
资源推荐
资源详情
资源评论
收起资源包目录
Amino 框架所有源码 (352个子文件)
BUILDING 914B
amino-0.1.0.tar.bz2 93KB
stm.c 62KB
clfmalloc.c 46KB
work.c 12KB
main.c 7KB
randalloc.c 7KB
larson.c 5KB
passive_false.c 2KB
threadtest.c 2KB
active_false.c 2KB
test_catomic.c 2KB
linux-scalability.c 1KB
CHANGES 0B
.classpath 513B
COPYING 0B
aasort.cpp 7KB
test_atomic.cpp 3KB
test_aasort.cpp 3KB
test_queue.cpp 3KB
randArrayGenerator.cpp 2KB
test_stack.cpp 2KB
test_iterator.cpp 2KB
test_list.cpp 2KB
test_psort.cpp 2KB
test_all.cpp 2KB
testconfig.cpp 2KB
test_dictionary.cpp 2KB
test_deque.cpp 2KB
test_future.cpp 2KB
test_pqueue.cpp 2KB
mutexTest.cpp 1KB
lockTest.cpp 1KB
test_pattern.cpp 1KB
test_counter.cpp 1KB
test_executor.cpp 1KB
test_set.cpp 1KB
test_bdeque.cpp 1KB
threadRunner.cpp 1KB
test_smr.cpp 1KB
test_cond.cpp 1KB
test_mutex.cpp 1KB
test_lock.cpp 1KB
accumulate.cpp 1KB
transform.cpp 1KB
tp_exec.cpp 1KB
condTest.cpp 1KB
test_align.cpp 1KB
single_exec.cpp 1KB
for_each.cpp 976B
stack_mt.cpp 805B
stack_st.cpp 256B
cstdatomic 31B
IBM Amino Corporate Contributor License Agreement.doc 118KB
IBM Amino Individual Contributor License Agreement.doc 117KB
Doxyfile 55KB
cbbs-cpp-apidocs-0.3.1.tar.gz 2.58MB
cbbs-cpp-src-0.3.0.tar.gz 1.07MB
cbbs-cpp-apidocs-0.5.3.tar.gz 1007KB
cbbs-cpp-apidocs-0.3.2.tar.gz 948KB
cbbs-cpp-linux-ia32-gcc-bin-0.3.0.tar.gz 931KB
cbbs-java-apidocs-0.3.1.tar.gz 901KB
cbbs-cpp-linux-x86_64-gcc-bin-0.3.0.tar.gz 868KB
cbbs-cpp-src-0.5.3.tar.gz 831KB
cbbs-java-bin-0.3.2.tar.gz 234KB
cbbs-java-bin-0.3.1.tar.gz 231KB
cbbs-java-bin-0.2.0.tar.gz 223KB
cbbs-cpp-src-0.3.2.tar.gz 193KB
cbbs-cpp-src-0.3.1.tar.gz 191KB
cbbs-java-apidocs-0.3.2.tar.gz 171KB
cbbs-java-bin-0.5.3.tar.gz 170KB
cbbs-java-src-0.3.1.tar.gz 145KB
cbbs-java-apidocs-0.5.3.tar.gz 144KB
cbbs-java-src-0.5.3.tar.gz 144KB
cbbs-java-src-0.3.2.tar.gz 144KB
cbbs-java-src-0.2.0.tar.gz 114KB
cbbs-cpp-linux-ia32-gcc-bin-0.3.1.tar.gz 71KB
cbbs-cpp-linux-ia32-gcc-bin-0.5.3.tar.gz 70KB
cbbs-cpp-linux-ia32-gcc-bin-0.3.2.tar.gz 70KB
cbbs-cpp-linux-x86_64-gcc-bin-0.3.1.tar.gz 70KB
cbbs-cpp-linux-x86_64-gcc-bin-0.3.2.tar.gz 70KB
cbbs-cpp-linux-x86_64-gcc-bin-0.5.3.tar.gz 69KB
cbbs-cpp-src-0.2.0.tar.gz 64KB
cbbs-cpp-linux64-x86_64-gcc-bin-0.2.0.tar.gz 35KB
cbbs-cpp-linux32-x86-gcc-0.2.0.tar.gz 33KB
impatomic.h 109KB
deque.h 43KB
lockfree_dictionary.h 33KB
xlc_builtins.h 25KB
gcc_builtins.h 24KB
gcc_builtins.h 24KB
compiler.h 23KB
smr.h 23KB
test_dictionary.h 22KB
lockfree_priorityqueue.h 20KB
list.h 16KB
ebstack.h 16KB
lockfree_set.h 16KB
stm_rw.h 13KB
stm.h 13KB
共 352 条
- 1
- 2
- 3
- 4
资源评论
匠心零度
- 粉丝: 9460
- 资源: 305
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- 【ERP标准流程-标准流程-进货管理】(DOC 17页).doc
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- Java爬虫项目【项目开发计划】(共12页).docx
- 11111111111
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功