skip to main content
article

Associating synchronization constraints with data in an object-oriented language

Authors Info & Claims
Published:11 January 2006Publication History
Skip Abstract Section

Abstract

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.

References

  1. Gul Agha. An overview of actor languages. In Proceedings of the 1986 SIGPLAN workshop on Object-oriented programming, pages 58--67, New York, NY, USA, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. C. S. Ananian and M. Rinard. Language-level transactions. In High-Performance Embedded Computing (HPEC), 2004.Google ScholarGoogle Scholar
  3. C. Artho, K. Havelund, and A. Biere. High-level data races. In Proc. NDDL/VVEIS'03, pages 82--93, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  4. C. Artho, K. Havelund, and A. Biere. Using block-local atomicity to detect stale-value concurrency errors. In ATVA'04, pages 150--164, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  5. D. F. Bacon, R. E. Strom, and A. Tarafdar. Guava: A dialect of Java without data races. In Proc. OOPSLA'00, pages 382--400, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. D. Bäumer, E. Gamma, and Adam Kieÿ zun. Integrating refactoring support into a Java development tool. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) Companion, October 2001.Google ScholarGoogle Scholar
  7. H. Berenson, P. Bernstein, J. Gray, J. Melton, E. O'Neil, and P. O'Neil. A critique of ANSI SQL isolation levels. In Proc. ACM SIGMOD Conf., pages 1--10, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. P. Bernstein, V. Hadzilacos, and N. Goodman. Concurrency Control and Recovery in Database Systems. Addison-Wesley, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. C. Boyapati and M. Rinard. A parameterized type system for race-free Java programs. In Proc. OOPSLA'01, October 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. Burrows and K. R. M. Leino. Finding stale-value errors in concurrent programs. Technical Report 2002-004, SRC, May 2002.Google ScholarGoogle Scholar
  11. Philippe Charles, Christopher Donawa, Kemal Ebcioglu, Christian Grothoff, Allan Kielstra, Vijay Saraswat, Vivek Sarkar, and Christoph von Praun. X10: An object-oriented approach to non-uniform cluster computing. In Proc. OOPSLA'05, San Diego, CA, 2005. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. A. Chien, U. Reddy, J. Plevyak, and J. Dolby. ICC++ - A C++ dialect for high performance parallel computing. Lecture Notes in Computer Science, 1049:76--95, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Andrew A. Chien and William J. Dally. Concurrent aggregates (ca). In Proc. PPoPP '90, pages 187--196, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. X. Deng, M. Dwyer, J. Hatcliff, and M. Mizuno. Invariant-based specification, synthesis, and verification of synchronization in concurrent programs. In Proc. ICSE'02, May 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. D. Engler and K. Ashcraft. Racerx: Effective, static detection of race conditions and deadlocks. In Proc. SOSP'03, pages 237--252, October 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. S. Fink, J. Dolby, , and L. Colby. Semi-automatic J2EE transaction configuration. Technical Report RC23326, IBM T.J. Watson Research Center, March 2004.Google ScholarGoogle Scholar
  17. C. Flanagan. Verifying commit-atomicity using model checking. In Proc. SPIN'04, pages 252--266, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  18. C. Flanagan, S. Freund, and M. Lifshin. Type inference for atomicity. In Proc. TLDI'05, pages 47--58, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. C. Flanagan and S. N. Freund. Type-based race detection for Java. In Proc. PLDI'00, pages 219--232, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. C. Flanagan and S. N. Freund. Atomizer: A dynamic atomicity checker for multithreaded programs. In Proc. POPL'04, pages 256--267, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. C. Flanagan and S. Qadeer. A type and effect system for atomicity. In Proc. PLDI'03, pages 338--349, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. C. Flanagan and S. Qadeer. Types for atomicity. In Proc. TLDI'03, pages 1--12, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. T. Harris and K. Fraser. Language support for lightweight transactions. In Proc. OOPSLA'03, pages 388--402, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. T. Harris, S. Marlow, S. Peyton-Jones, and M. Herlihy. Composable memory transactions. In Proc. PPoPP'05, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. J. Hatcliff, Robby, and M. B. Dwyer. Verifying atomicity specifications for concurrent object-oriented software using model checking. In Proc. VMCAI'04, pages 175--190, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  26. Gary A. Kildall. A unified approach to global program optimization. In Proc. POPL'73, pages 194--206, 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. K. R. M. Leino. Data groups: Specifying the modification of extended state. In Proc. OOPSLA'98, pages 144--153, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. K. R. M. Leino, J. B. Saxe, and R. Stata. Checking Java programs via guarded commands. Technical Report 002, Compaq SRC, 1999.Google ScholarGoogle Scholar
  29. R. J. Lipton. Reduction: A method of proving properties of parallel programs. CACM, 18(12), 1975. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. R. O'Callahan and J.-D. Choi. Hybrid dynamic data race detection. In Proc. PPoPP'03, pages 167--178, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Java Community Process. JSR 166: Concurrency utilities. See http://gee.cs.oswego.edu/dl/concurrency-interest/index.html., September 2004.Google ScholarGoogle Scholar
  32. A. Sasturkar, R. Agarwal, L. Wang, and S. Stoller. Automated type-based analysis of data races and atomicity. In Proc. PPoPP'05, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson. Eraser: a dynamic data race detector for multi-threaded programs. In Proc. SOSP'97, pages 27--37, October 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. C. von Praun and T. Gross. Static detection of atomicity violations in object-oriented programs. Journal of Object Technology, 3(2), 2004.Google ScholarGoogle Scholar
  35. Liqiang Wang and Scott D. Stoller. Runtime analysis for atomicity for multi-threaded programs. Technical Report DAR-04-14, State University of New York At Stony Brook, May 2005.Google ScholarGoogle Scholar
  36. A. Welc, S. Jagannathan, and A. Hosking. Transactional monitors for concurrent objects. In Proc. ECOOP'04, pages 519--542, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  37. ANSI X3.135-1992. In American National Standard for Information Systems -- Database Language -- SQL, November 1992.Google ScholarGoogle Scholar
  38. M. Xu, R. Bodik, and M. Hill. A serializability violation detector for shared-memory server programs. In Proc. PLDI'05, pages 1--14, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Associating synchronization constraints with data in an object-oriented language

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              • Published in

                cover image ACM SIGPLAN Notices
                ACM SIGPLAN Notices  Volume 41, Issue 1
                Proceedings of the 2006 POPL Conference
                January 2006
                421 pages
                ISSN:0362-1340
                EISSN:1558-1160
                DOI:10.1145/1111320
                Issue’s Table of Contents
                • cover image ACM Conferences
                  POPL '06: Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
                  January 2006
                  432 pages
                  ISBN:1595930272
                  DOI:10.1145/1111037

                Copyright © 2006 ACM

                Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 11 January 2006

                Check for updates

                Qualifiers

                • article

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader