面向STM的松弛存储一致性算法
收稿日期: 2008-04-13
修回日期: 2008-07-10
网络出版日期: 2010-01-18
A Relaxed Memory Consistency Algorithm for STM
Received date: 2008-04-13
Revised date: 2008-07-10
Online published: 2010-01-18
软件事务性内存(STM)提供同步手段,让多线程程序高效并发执行。如果两个事务访问了同一个共享数据且至少一个事务进行了修改操作,则称发生了冲突。检测冲突后,一般选择一个事务终止。当前的STM实现都基于严格的线性一致性(Linearizability)语义模型,实现简单。但是,基于该语义会导致很多本来可以完成提交的事务失败,降低了系统效率。把因果一致性模型应用于STM,可以在保证程序准确性条件下取得较好的实际性能。实验数据表明,该算法简单高效,明显减少了冲突数目。
关键词: 软件事务性内存(STM); 因果一致性; 验证; 并发; 多线程
张小强 , 彭林 , 黄春 , 谢伦国 . 面向STM的松弛存储一致性算法[J]. 计算机工程与科学, 2010 , 32(1) : 127 -131 . DOI: 10.3969/j.issn.1007130X.2010.
Software transactional memory (STM) systems use lightweight and inmemory software transactions to address concurrency in multithreaded applications, ensuring the safety at all times. Two concurrent transactions cause conflict if they access the same object and at least one of them modifies that object. When an STM system identifies a conflict, it typically allows one transaction to continue, and delays or aborts the other. The current implementation of transactional memories (TMs) has the advantage of being simple and efficient, and providing strong linearizability semantics. But in many applications,enforcing a strict linearizability consistency policy over the entire readset of a transaction can lead to a large number of unnecessary aborts. In this paper, we investigate the use of Causal Consistency with weaker semantics,which provides a good tradeoff between strong semantics and good practical performance even for long transactions. The experimental results show that the implementation is simple, and substantially reduces the number of conflicts.
/
| 〈 |
|
〉 |