Skip to main content

Static Analyses for Eliminating Unnecessary Synchronization from Java Programs

  • Conference paper
  • First Online:
Static Analysis (SAS 1999)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1694))

Included in the following conference series:

Abstract

This paper presents and evaluates a set of analyses designed to reduce synchronization overhead in Java programs. Monitor-based synchronization in Java often causes significant overhead, accounting for 5–10% of total execution time in our benchmark applications. To reduce this overhead, programmers often try to eliminate unnecessary lock operations by hand. Such manual optimizations are tedious, error-prone, and often result in poorly structured and less reusable programs. Our approach replaces manual optimizations with static analyses that automatically find and remove unnecessary synchronization from Java programs. These analyses optimize cases where a monitor is entered multiple times by a single thread, where one monitor is nested within another, and where a monitor is accessible by only one thread. A partial implementation of our analyses eliminates up to 70% of synchronization overhead and improves running time by up to 5% for several already hand-optimized benchmarks. Thus, our automated analyses have the potential to significantly improve the performance of Java applications while enabling programmers to design simpler and more reusable multithreaded code.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. T. E. Anderson, E. D. Lazowska and H. M. Levy. The Performance Implications of Thread Management Alternatives for Shared-Memory Multiprocessors. IEEE Transactions on Computers 38(12), December 1989, pp. 1631–1644.

    Article  Google Scholar 

  2. D. Bacon, R. Konuru, C. Murthy, M. Serrano. Thin Locks: Featherweight Synchronization for Java. In Proceedings of the 1998 Conference on Programming Language Design and Implementation, Montreal, Canada, June 1998.

    Google Scholar 

  3. H. Boehm and M. Weiser. Garbage Collection in an Uncooperative Environment. Software Practice & Experience, September 1988, pp. 807–820.

    Google Scholar 

  4. J. Corbett. Using Shape Analysis to Reduce Finite-State Models of Concurrent Java Programs. In Proceedings of the International Symposium on Software Testing and Analysis, March 1998. A more recent version is University of Hawaii ICS-TR-98-20, available at http://www.ics.hawaii.edu/~corbett/pubs.html.

  5. J. Dean, G. DeFouw, D. Grove, V. Litvinov, and C. Chambers. Vortex: An Optimizing Compiler for Object-Oriented Languages. In Proceedings of the Eleventh Conference on Object-Oriented Programming, Systems, Languages, and Applications, October 1996.

    Google Scholar 

  6. David L. Detlefs, K. Rustan, M. Leino, Greg Nelson, and James B. Saxe. Extended Static Checking. Compaq SRC Research Report 159. 1998.

    Google Scholar 

  7. P. Diniz and M. Rinard. Lock Coarsening: Eliminating Lock Overhead in Automatically Parallelized Object-based Programs. In Journal of Parallel and Distributed Computing, Volume 49,Number 2, March 1998, pp. 218–244.

    Article  MATH  Google Scholar 

  8. J. Dolby. Automatic Inline Allocation of Objects. In Proceedings of the 1997 ACM SIGPLAN Conference on Programming Language Design and Implementation, June 1997.

    Google Scholar 

  9. C. M. Geschke, J. H. Morris and E. H. Satterthwaite. Early Experiences with Mesa. Communications of the Association for Computing Machinery, 20(8), August 1977, pp. 540–553.

    MATH  Google Scholar 

  10. J. Gosling, B. Joy, and G. Steele. The Java Language Specification. Addison-Wesley, 1996.

    Google Scholar 

  11. D. Grove, G. DeFouw, J. Dean, and C. Chambers. Call Graph Construction in Object-Oriented Languages. In Proceedings of the 12th Conference on Object-Oriented Programming, Systems, Languages, and Applications, 1997.

    Google Scholar 

  12. J. Hogg. Islands: Aliasing Protection in Object-Oriented Languages. In Proceedings of the Sixth Conference on Object-Oriented Programming, Systems, Languages, and Applications, November 1991.

    Google Scholar 

  13. D. Keppel. Tools and Techniques for Building Fast Portable Thread Packages. University of Washington Technical Report UW CSE 93-05-06, May 1993.

    Google Scholar 

  14. A. Krall and M. Probst. Monitors and Exceptions: How to implement Java efficiently. ACM 1998 Workshop on Java for High-Performance Network Computing, 1998.

    Google Scholar 

  15. B. Lampson and D. Redell. Experience with Processes and Monitors in Mesa. In Communications of the Association for Computing Machinery 23(2), February 1980, pp. 105–117.

    Google Scholar 

  16. N. Minsky. Towards Alias-Free Pointers. In Proceedings of the 10th European Conference on Object Oriented Programming, Linz, Austria July 1996.

    Google Scholar 

  17. J. Noble, J. Vitek, and J. Potter. Flexible Alias Protection. In Proceedings of the 12th European Conference on Object Oriented Programming, Brussels, Belgium, July 1998.

    Google Scholar 

  18. J. Plevyak, X. Zhang, and A. Chien. Obtaining Sequential Efficiency for Concurrent Object-Oriented Languages. In Proceedings of the 22nd Symposium on Principles of Programming Languages, San Francisco, CA, January 1995.

    Google Scholar 

  19. Olin Shivers. Control-Flow Analysis in Scheme. SIGPLAN Notices, 23(7):164–174, July 1988. In Proceedings of the ACM SIGPLAN’ 88 Conference on Programming Language Design and Implementation.

    Article  Google Scholar 

  20. S. Singhal, B. Nguyen, R. Redpath, M. Fraenkel, and J. Nguyen. Building High-Performance Applications and Services in Java: An Experiential Study. IBM T.J. Watson Research Center white paper, available at http://www.ibm.com/java/education/javahipr.html. 1997.

  21. E. G. Sirer, A. J. Gregory, N.R. Anderson, B.N. Bershad. Distributed Virtual Machines: A System Architecture for Network Computing. In Proceedings of the Eighth ACM SIGOPS European Workshop, September 1998.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Aldrich, J., Chambers, C., Sirer, E.G., Eggers, S. (1999). Static Analyses for Eliminating Unnecessary Synchronization from Java Programs. In: Cortesi, A., Filé, G. (eds) Static Analysis. SAS 1999. Lecture Notes in Computer Science, vol 1694. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-48294-6_2

Download citation

  • DOI: https://doi.org/10.1007/3-540-48294-6_2

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-66459-8

  • Online ISBN: 978-3-540-48294-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics