skip to main content
10.1145/320384.320388acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article
Free Access

Removing unnecessary synchronization in Java

Authors Info & Claims
Published:01 October 1999Publication History

ABSTRACT

Java programs perform many synchronization operations on data structures. Some of these synchronization are unnecessary; in particular, if an object is reachable only by a single thread, concurrent access is impossible and no synchronization is needed. We describe an interprocedural, flow- and context-insensitive dataflow analysis that finds such situations. A global optimizing transformation then eliminates synchronizations on these objects. For every program in our suite of ten Java benchmarks consisting of SPECjvm98 and others, our system optimizes over 90% of the alias sets containing at least one synchronized object. As a result, the dynamic frequency of synchronizations is reduced by up to 99%. For two benchmarks that perform synchronizations very frequently, this optimization leads to speedups of 36% and 20%.

References

  1. 1.Ole Agesen, David Detlefs, Alex Garthwaite, Ross Knippel, Y. S. Ramakrishna, and Derek White. An Efficient Meta-Lock for Implementing Ubiquitous Synchronization. In Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA '99), Denver, Colorado, 1-5 November 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2.Jonathan Aldrich, Craig Chambers, Emin Gun Sirer, and Susan Eggers. Static Analyses for Eliminating Unnecessary Synchronization from Java Programs. in Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA '99), Denver, Colorado, 1-5 November 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3.David E Bacon. Fast and Efficient Optimization of Statically Typed Object-Oriented Languages. Ph.D. thesis, University of California, Berkeley, October 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4.David F. Bacon, Ravi Konuru, Chet Murthy, and Mauricio Serrano. Thin Locks: Featherweight Synchronization for Java. in Proceedings of the A CM SIGPLAN '98 Conference on Programming Language Design and Implementation (PLDI '98), pages 258-268, Montreal, Canada, May 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5.Bruno Blanchet. Escape analysis: Correctness Proof, Implementation and Experimental Results. in Conference Record of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '98), pages 25-37, San Diego, California, 19-21 January 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6.J.-D. Choi, M. Gupta, M. Serrano, V. C. Sreedhar, and S. Midkiff. Escape Analysis for Java. In Proceedings of Object- Oriented Programming, Systems, Languages, and Applications (OOPSLA "99), Denver, Colorado, 1-5 November t999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7.James C. Corbett. Using Shape Analysis to Reduce Finite- State Models of Concurrent Java Programs. Technical Report ICS-TR-98-20, Department of Information and Computer Science, University of Hawaii, October 14, 1998.Google ScholarGoogle Scholar
  8. 8.Pedro Diniz and Martin Rinard. Lock Coarsening: Eliminating Lock Overhead in Automatically Parallelized Object- Based Programs. In Journal of Parallel and Distributed Computing 49(2), March 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9.Julian Dolby. Automatic Inline Allocation of Objects. In Proceedings of the 1997 A CM SIGPLAN Conference on Programming Language Design and Implementation (PLDI '97), pages 7-17, Las Vegas, Nevada, June 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10.Julian Dolby and Andrew A. Chien. An Evaluation of Automatic Object lnline Allocation Techniques. In Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA '98), pages 1-20, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11.Andrew Duncan, Bogdan Cocosel, Costin lancu, Holger Kiente, Radu P, ugina, Urs H61zle, and Martin Rinard. OSUIF: SUIF 2.0 With Objects. Overview paper from the SUIF Workshop at Stanford University, August 1997.Google ScholarGoogle Scholar
  12. 12.Robert Fitzgerald, Todd B. Knoblock, Erik Ruf, Bjame Steensgaard, and David Tarditi. Marmot: an Optimizing Compiler for Java. Microsoft Technical Report, November 1998.Google ScholarGoogle Scholar
  13. 13.David Gay and Bjarne Steensgaard. Stack Allocating Objects In Java. Microsoft Technical Report, November 1998.Google ScholarGoogle Scholar
  14. 14.Rakesh Ghiya and Laurie J. Hendren. Is it a Tree, a DAG, or a Cyclic Graph? A Shape Analysis for Heap-Directed Pointers in C. In Conference Record of the 23rd ACM SIGPLAN- SIGACT Symposium on Principles of Programming Languages (POPL '96), pages 1-15, St. Petersburg Beach, Florida, 21-24 January 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 15.James Gosling, Bill Joy, and Guy Steele. The java Language Specification. Addison-Wesley: Berkeley, California, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 16.Allan Heydon and Marc Najork. Performance Limitations of the Java Core Libraries. In Proceedings of the 1999 ACM Java Grande Conference, pages 35-41, June 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 17.Java Generic Library (JGL). http://www.objectspace.corn/ products/jgl.Google ScholarGoogle Scholar
  18. 18.JavaClass parsing library, http://www.inf.fu-berlin.de/-dahrn/ JavaClass.Google ScholarGoogle Scholar
  19. 19.JavaCUP parser generator, http://www.cs.princeton.edu/ -appel/moderrffj ava/CUP.Google ScholarGoogle Scholar
  20. 20.JLex lexieal analyzer generator, http://www.cs.princeton.edu/ -appel/modem/j ava/JLex.Google ScholarGoogle Scholar
  21. 21.Holger Kienle and Urs HOlzle. j2s: A SUIF Java compiler. In Proceedings of the Second SUIF Compiler Workshop, pages 8-15, August 1997. Also available as Technical Report TRCS98-18, Department of Computer Science, University of California, Santa Barbara. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 22.Andreas Krall. Efficient Java VM Just-in-Time Compilation. In Proceedings of the International Conference on Parallel Architectures and Compilation Techniques (PACT '98), pages 12-18, Paris, France, October 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 23.Andreas Krall and Mark Probst. Monitors and Exceptions: How to implement Java efficiently. In S. Hassanzadeh and K. Schauser, editors, ACM 1998 Workshop on Java for High-Performance Network Computing, pages 15-24, Palo Alto, March 1998. ACM.Google ScholarGoogle ScholarCross RefCross Ref
  24. 24.Tim Lindholm and Frank Yellin. The Java Virtual Machine Specification. Addison-Wesley: Berkeley, California, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. 25.C. E. McDowell. Reducing garbage in Java. In ACM SIG- PLAN Notices 33(9), September 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. 26.Gilles Muller, BArbara Moura, Fabrice Bellard, and Charles Consel. Harissa: a Flexible and Efficient Java Environment Mixing Bytecode and Compiled Code. In Proceedings of the Third Conference on Object-Oriented Technologies and Systems (COOTS '97), pages 1-20, Berkeley, California, June 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. 27.Cristina Ruggieri and Thomas E Murtagh. Lifetime Analysis of Dynamically Allocated Objects. In Conference Record of the Fifteenth Annual ACM Symposium on Principles of Programming Languages, pages 285-293, San Diego, California, 13-15 January 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. 28.Radu Rugina and Martin Rinard. Pointer Analysis for Multithreaded Programs. In Proceedings of the 1999 ACM SIG- PLAN Conference on Programming Language Design and Implementation (PLDI '99), pages 77-90, Atlanta, GA, May, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. 29.Mooly Sagiv, Thomas Reps, and Reinhard Wilhelm. Solving Shape-Analysis Problems in Languages with Destructive Updating. In Conference Record of the 23rd ACM SIGPLAN- SIGACT Symposium on Principles of Programming Languages (POPL '96), pages 16-31, St. Petersburg Beach, Florida, 21-24 January 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. 30.SPEC Java virtual machine benchmark suite. Standard Performance Evaluation Corporation. SPECjvm98 Documentation, Release 1.0. August 1998. http:llwww.spec.org/osgljvm981 j vm98/doc/index.html.Google ScholarGoogle Scholar
  31. 31.Robert P. Wilson and Monica S. Lam. Efficient Context-Sensitive Pointer Analysis for C Programs. In Proceedings of the 1995 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI '95), pages 1-12, La Jolla, California, 18-21 June 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Removing unnecessary synchronization in Java

          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
          • Published in

            cover image ACM Conferences
            OOPSLA '99: Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
            October 1999
            462 pages
            ISBN:1581132387
            DOI:10.1145/320384

            Copyright © 1999 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: 1 October 1999

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • Article

            Acceptance Rates

            OOPSLA '99 Paper Acceptance Rate30of152submissions,20%Overall Acceptance Rate268of1,244submissions,22%

            Upcoming Conference

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader