• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

J4 ›› 2010, Vol. 32 ›› Issue (1): 127-131.doi: 10.3969/j.issn.1007130X.2010.

• 论文 • 上一篇    下一篇

面向STM的松弛存储一致性算法

  

  1. (国防科学技术大学计算机学院,湖南 长沙 410073)
  • 收稿日期:2008-04-13 修回日期:2008-07-10 出版日期:2010-01-18 发布日期:2010-01-18
  • 通讯作者: 张小强 E-mail:xqzhang@nudt.edu.cn
  • 作者简介:张小强(1973-),男,陕西宝鸡人,博士生,研究方向为编译技术;彭林,博士生,研究方向为编译技术。

A Relaxed Memory Consistency Algorithm for STM

  1. (School of Computer Science,National University of Defense Technology,Changsha 410073,China)
  • Received:2008-04-13 Revised:2008-07-10 Online:2010-01-18 Published:2010-01-18

摘要:

软件事务性内存(STM)提供同步手段,让多线程程序高效并发执行。如果两个事务访问了同一个共享数据且至少一个事务进行了修改操作,则称发生了冲突。检测冲突后,一般选择一个事务终止。当前的STM实现都基于严格的线性一致性(Linearizability)语义模型,实现简单。但是,基于该语义会导致很多本来可以完成提交的事务失败,降低了系统效率。把因果一致性模型应用于STM,可以在保证程序准确性条件下取得较好的实际性能。实验数据表明,该算法简单高效,明显减少了冲突数目。

关键词: 软件事务性内存(STM), 因果一致性, 验证, 并发, 多线程

Abstract:

Software transactional memory (STM) systems use lightweight and inmemory software transactions to address concurrency in multithreaded 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 readset 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 tradeoff 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.

Key words: software transactional memory (STM);causal consistency;validation;concurrency;threads

中图分类号: