科技报告详细信息
Tech Report: HPL-2005-217: Reordering Constraints for Pthread-Style
Boehm, Hans-J.
HP Development Company
关键词: threads;    locks;    memory barriers;    memory fences;    code reordering;    data race;    pthreads;    optimization;   
RP-ID  :  HPL-2005-217
学科分类:计算机科学(综合)
美国|英语
来源: HP Labs
PDF
【 摘 要 】

C or C++ programs relying on the pthreads interface for concurrency are required to use a specified set of functions to avoid data races, and to ensure memory visibility across threads. Although the detailed rules are not completely clear[8], it is not terribly hard to refine them to a simple set of clear and uncontroversial rules for at least a subset of the C language that excludes structures (and hence bit- fields). We precisely address the question of how locks in this subset must be implemented, and particularly when other memory operations can be reordered with respect to locks. Although our precise arguments are limited to a small subset language, we believe that our results capture the situation for a full C/C++ implementation, together with a literal (and reasonable, though possibly unintended) interpretation of the pthread standard. And they appear to have implications for other environments as well. The results appear to be surprising, and to not have been anticipated by pthread implementors, in spite of their significant performance impact on multi-threaded applications. Notes: 9 Pages

【 预 览 】
附件列表
Files Size Format View
RO201804100001111LZ 194KB PDF download
  文献评价指标  
  下载次数:15次 浏览次数:86次