Associating synchronization constraints with data in an object-oriented language

被引:61
作者
Vaziri, M [1 ]
Tip, F [1 ]
Dolby, J [1 ]
机构
[1] IBM Corp, Thomas J Watson Res Ctr, Yorktown Hts, NY 10598 USA
关键词
languages; theory; concurrent object-oriented programming; data races; serializability; programming model;
D O I
10.1145/1111320.1111067
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Concurrency-related bugs may happen when multiple threads access shared data and interleave in ways that do not correspond to any sequential execution. Their absence is not guaranteed by the traditional notion of "data race" freedom. We present a new definition of data races in terms of 11 problematic interleaving scenarios, and prove that it is complete by showing that any execution not exhibiting these scenarios is serializable for a chosen set of locations. Our definition subsumes the traditional definition of a data race as well as high-level data races such as stale-value errors and inconsistent views. We also propose a language feature called atomic sets of locations, which lets programmers specify the existence of consistency properties between fields in objects, without specifying the properties themselves. We use static analysis to automatically infer those points in the code where synchronization is needed to avoid data races under our new definition. An important benefit of this approach is that, in general, far fewer annotations are required than is the case with existing approaches such as synchronized blocks or atomic sections. Our implementation successfully inferred the appropriate synchronization for a significant subset of Java's Standard Collections framework.
引用
收藏
页码:334 / 345
页数:12
相关论文
共 38 条
[1]  
AGHA G, 1986, SIGPLAN NOTICES, V21, P58, DOI 10.1145/323648.323743
[2]  
ANANIAN CS, 2004, HIGH PERFORMANCE EMB
[3]  
*ANSI, 1992, X31351992 ANSI
[4]  
Artho C, 2004, LECT NOTES COMPUT SC, V3299, P150
[5]  
Artho C, 2003, P NDDL VVEIS 03, P82
[6]  
BACON D, 2000, P ACM C OBJ OR PROGR, P382
[7]  
BAUMER D, 2001, OBJECT ORIENTED PROG
[8]  
Berenson H., 1995, SIGMOD Record, V24, P1, DOI 10.1145/568271.223785
[9]  
Bernstein P.A., 1987, Concurrency Control and Recovery in Database Systems
[10]  
BOYAPATI C, 2001, P OOPSLA 01 OCT