Associating synchronization constraints with data in an object-oriented language

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.

[1]  David F. Bacon,et al.  Guava: a dialect of Java without data races , 2000, OOPSLA '00.

[2]  Simon L. Peyton Jones,et al.  Composable memory transactions , 2005, CACM.

[3]  Andrew A. Chien,et al.  Concurrent aggregates (CA) , 1990, PPOPP '90.

[4]  Julian Dolby,et al.  Semi-Automatic J2EE Transaction Configuration , 2004 .

[5]  Dawson R. Engler,et al.  RacerX: effective, static detection of race conditions and deadlocks , 2003, SOSP '03.

[6]  Jim Gray,et al.  A critique of ANSI SQL isolation levels , 1995, SIGMOD '95.

[7]  Rahul Agarwal,et al.  Automated type-based analysis of data races and atomicity , 2005, PPoPP.

[8]  Martin C. Rinard,et al.  A parameterized type system for race-free Java programs , 2001, OOPSLA '01.

[9]  Thomas R. Gross,et al.  Static Detection of Atomicity Violations in Object-Oriented Programs , 2004, J. Object Technol..

[10]  Suresh Jagannathan,et al.  Transactional Monitors for Concurrent Objects , 2004, ECOOP.

[11]  Andrew A. Chien,et al.  ICC++—a C++ dialect for high performance parallel computing , 1996, SIAP.

[12]  Scott D. Stoller,et al.  Runtime analysis for atomicity for multi-threaded programs , 2005 .

[13]  K. Rustan M. Leino,et al.  Checking Java Programs via Guarded Commands , 1999, ECOOP Workshops.

[14]  Cormac Flanagan,et al.  A type and effect system for atomicity , 2003, PLDI.

[15]  M. Burrows,et al.  Finding stale‐value errors in concurrent programs , 2004, Concurr. Pract. Exp..

[16]  Cormac Flanagan,et al.  Types for atomicity , 2003, TLDI '03.

[17]  Min Xu,et al.  A serializability violation detector for shared-memory server programs , 2005, PLDI '05.

[18]  Armin Biere,et al.  High‐level data races , 2003, Softw. Test. Verification Reliab..

[19]  Stephen N. Freund,et al.  Atomizer: a dynamic atomicity checker for multithreaded programs , 2004, 18th International Parallel and Distributed Processing Symposium, 2004. Proceedings..

[20]  Matthew B. Dwyer,et al.  Verifying Atomicity Specifications for Concurrent Object-Oriented Software Using Model-Checking , 2004, VMCAI.

[21]  G. Agha An overview of actor languages , 1986, OOPWORK '86.

[22]  Gary A. Kildall,et al.  A unified approach to global program optimization , 1973, POPL.

[23]  Stephen N. Freund,et al.  Type inference for atomicity , 2005, TLDI '05.

[24]  Jong-Deok Choi,et al.  Hybrid dynamic data race detection , 2003, PPoPP '03.

[25]  Michael Burrows,et al.  Eraser: a dynamic data race detector for multi-threaded programs , 1997, TOCS.

[26]  Keir Fraser,et al.  Language support for lightweight transactions , 2003, SIGP.

[27]  Adam Kiezun,et al.  Integrating Refactoring Support into a Java Development Tool , 2001, OOPSLA 2001.

[28]  Stephen N. Freund,et al.  Type-based race detection for Java , 2000, PLDI '00.

[29]  Cormac Flanagan,et al.  Verifying Commit-Atomicity Using Model-Checking , 2004, SPIN.

[30]  Michael Burrows,et al.  Eraser: a dynamic data race detector for multithreaded programs , 1997, TOCS.

[31]  K. Rustan M. Leino,et al.  Data groups: specifying the modification of extended state , 1998, OOPSLA '98.

[32]  Vivek Sarkar,et al.  X10: an object-oriented approach to non-uniform cluster computing , 2005, OOPSLA '05.

[33]  Armin Biere,et al.  Using Block-Local Atomicity to Detect Stale-Value Concurrency Errors , 2004, ATVA.

[34]  Richard J. Lipton,et al.  Reduction: a method of proving properties of parallel programs , 1975, CACM.

[35]  Masaaki Mizuno,et al.  Invariant-based specification, synthesis, and verification of synchronization in concurrent programs , 2002, ICSE '02.

[36]  Andrew A. Chien,et al.  ICC++-AC++ Dialect for High Performance Parallel Computing , 1996, ISOTAS.