skip to main content
article

Static conflict analysis for multi-threaded object-oriented programs

Published:09 May 2003Publication History
Skip Abstract Section

Abstract

A compiler for multi-threaded object-oriented programs needs information about the sharing of objects for a variety of reasons: to implement optimizations, to issue warnings, to add instrumentation to detect access violations that occur at runtime. An Object Use Graph (OUG) statically captures accesses from different threads to objects. An OUG extends the Heap Shape Graph (HSG), which is a compile-time abstraction for runtime objects (nodes) and their reference relations (edges). An OUG specifies for a specific node in the HSG a partial order of events relevant to the corresponding runtime object(s). Relevant events include read and write access, object escape, thread start and join.OUGs have been implemented in a Java compiler. Initial experience shows that OUGs are effective to identify object accesses that potentially conflict at runtime and isolate accesses that never cause a problem at runtime. The capabilities of OUGs are compared with an advanced program analysis that has been used for lock elimination. For the set of benchmarks investigated here, OUGs report only a fraction of shared objects as conflicting and reduce the number of compile-time reports in terms of allocation sites of conflicting objects by 28--92% (average 64%). For benchmarks of up to 30 KLOC, the time taken to construct OUGs is, with one exception, in the order of seconds.The information collected in the OUG has been used to instrument Java programs with checks for object races. OUGs provide precise information about object sharing and static protection, so runtime instrumentation that checks those cases that cannot be disambiguated at compile-time is sparse, and the total runtime overhead of checking for object races is only 3--86% (average 47%).

References

  1. D. Bacon, R. Strom, and A. Tarafdar. Guava: A dialect of Java without data races. In Proc. Conf. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'00), pages 382--400, Oct. 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. B. Blanchet. Escape analysis for object-oriented languages - Application to Java. In Proc. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'99), pages 20--34, Nov. 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. J. Bogda and U. Hölzle. Removing unnecessary synchronization in Java. In Proc. Conf. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'99), pages 35--46, Nov. 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. C. Boyapati, R. Lee, and M. Rinard. Ownership types for safe programming: preventing data races and deadlocks. In Proc. Conf. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'02), pages 211--230, Nov. 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. G. Bristow, C. Dreay, B. Edwards, and W. Riddle. Anomaly detection in concurrent programs. In Proc. Intl. Conf. on Software Engineering (ICSE'79), pages 265--273, 1979.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. Choi, M. Gupta, M. Serrano, V. Sreedhar, and S. Midkiff. Escape analysis for Java. In Proc. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'99), pages 1--19. ACM Press, Nov. 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J.-D. Choi, K. Lee, A. Loginov, R. O'Callahan, V. Sarkar, and M. Sridharan. Efficient and precise datarace detection for multithreaded object-oriented programs. In Conf. Programming Language Design and Implementation (PLDI'02), pages 258--269, June 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. P. Diniz and M. Rinard. Synchronization transformation for parallel computing. In Proc. Symp. Principles of Programming Languages (POPL'97), pages 187--200, Jan. 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. E. Duesterwald and M. Soffa. Concurrency analysis in the presence of procedures using a data-flow framework. In Proc. Symp. Testing, Analysis and Verification (TAV4), pages 36--48, 1993.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. C. Flanagan and S. Freund. Type-based race detection for Java. In Proc. Conf. Programming Language Design and Implementation (PLDI'00), pages 219--229, June 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. C. Flanagan and S. Freund. Detecting race conditions in large programs. In Proc. Workshop Program Analysis for Software Tools and Engineering (PASTE'01), pages 90--96, June 18--19 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. GNU Software. gcj - The GNU compiler for the Java programming language. http://gcc.gnu.org/java, 2000.]]Google ScholarGoogle Scholar
  13. A. Heydon, R. Levin, and Y. Yu. Caching function calls using precise dependencies. In Proc. Conf. Programming Language Design and Implementation (PLDI'00), pages 311--320, June 18--21 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. C. Hoare. Monitors: An operating system structuring concept. Communications of the ACM, 17(10):549--557, Oct. 1974.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Java Grande Forum. Multi-threaded benchmark suite. http://www.epcc.ed.ac.uk/javagrande/, 1999.]]Google ScholarGoogle Scholar
  16. L. Lamport. How to make a correct multiprocess program execute correctly on a multiprocessor. IEEE Trans. on Computers, 46(7):779--782, July 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. Masticola and B. Ryder. Non-concurrency analysis. In Proc. Symp. Principles and Practice of Parallel Programming (PPoPP'93), pages 129--138, 1993.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. S. Midkiff, J. Lee, and D. Padua. A compiler for multiple memory models. In Rec. 9th Workshop Compilers for Parallel Computers (CPC'01), June 2001.]]Google ScholarGoogle Scholar
  19. G. Naumovich, G. Avrunin, and L. Clarke. An efficient algorithm for computing MHP information for concurrent Java programs. In Proc. 7th European Software Engineering Conf. and 7th Symp. Foundations of Software Engineering, pages 338--354, Sept. 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. M. Rinard. Analysis of multithreaded programs. In Proc. Static Analysis Symp. (SAS'01), July 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. E. Ruf. Effective synchronization removal for Java. In Proc. Conf. Programming Language Design and Implementation (PLDI'00), pages 208--218, June 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. R. Rugina and M. Rinard. Pointer analysis for multithreaded programs. In Proc. Conf. Programming Language Design and Implementation (PLDI'99), pages 77--90, May 1--4, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. D. Schmidt and T. Harrison. Double-checked locking: An optimization pattern for efficiently initializing and accessing thread-safe objects. In F. Buschmann, R. Martin, and D. Riehle, editors, Pattern Languages of Program Design (PLoP) 3, pages 363--375, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. D. Shasha and M. Snir. Efficient and correct execution of parallel programs that share memory. ACM Trans. on Programming Languages and Systems, 10(2):282--312, Apr. 1988.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. E. Stolte, C. von Praun, G. Alonso, and T. Gross. Scientific data repositories -- designing for a moving target. In Proc. Conf. ACM SIGMOD/PODS, June 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. V. Sundaresan, L. J. Hendren, C. Razafimahefa, R. Vallée-Rai, P. Lam, E. Gagnon, and C. Godin. Practical virtual method call resolution for java. In Proc. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'00), pages 264--280, Oct. 15--19 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. R. Taylor. A general purpose algorithm for analyzing concurrent programs. Communications of the ACM, 26(5):362--376, May 1983.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. The Standard Performance Evaluation Corporation. SPEC JVM98 Benchmarks. http://www.spec.org/osg/jvm98, 1996.]]Google ScholarGoogle Scholar
  29. C. von Praun and T. Gross. Object race detection. In Proc. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'01), pages 70--82, Oct. 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. J. Whaley and M. Rinard. Compositional pointer and escape analysis for Java programs. In Proc. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'99), pages 187--206, Nov. 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Static conflict analysis for multi-threaded object-oriented programs

      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 38, Issue 5
        May 2003
        349 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/780822
        Issue’s Table of Contents
        • cover image ACM Conferences
          PLDI '03: Proceedings of the ACM SIGPLAN 2003 conference on Programming language design and implementation
          June 2003
          360 pages
          ISBN:1581136625
          DOI:10.1145/781131

        Copyright © 2003 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: 9 May 2003

        Check for updates

        Qualifiers

        • article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader