Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/2002962.2002970acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

Refactoring Java programs using concurrent libraries

Published: 17 July 2011 Publication History

Abstract

Multithread programming is becoming ever-more important to exploit the capabilities of multicore processors. Versions of Java prior to version 5 provide only the synchronized construct as a consistency primitive, which causes a performance scalability problem for multicore machines. Therefore, Java 5 added the java.util.concurrent package to reduce lock contention. Programmers must manually rewrite their existing code to use this package in existing programs. There are two typical rewritings methods. One is to replace an operation on a variable within a synchronized block with an atomic-lock-free version. The other is to replace a sequential concurrent class with its concurrent version. The conventional rewriting approach has three deficiencies. One problem is transformations that may change the behavior of a program. The second problem is missed modifications to be rewritten. The third problem is two difference writing techniques are applied individually to each code fragment even in the same method. This paper describes our refactoring algorithms that address these three problems as they rewrite Java code for scalable performance. We use inter-procedural pointer analysis and consistency tests among the candidate code fragments.

References

[1]
Andersen, L. O. Program Analysis and Specialization for the C Programming Language. PhD thesis, University of Copenhagen, Denmark, 1994.
[2]
Balaban, I., Tip, F., and Fuhrer, R. Refactoring support for class library migration, In Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2005.
[3]
Dig, D., Marrero, J., and Ernst, M. D. How do programs become more concurrent? A story of program transformations. Technical Report IT-CSAIL-TR-2008-053, MIT, 2008.
[4]
Dig, D., Marrero, J., and Ernst, M. D. Refactoring sequential Java code for concurrency via concurrent libraries. In Proceedings of international Conference on Software Engineering, 2009.
[5]
Goetz, B., Peierls, T., Bloch, J., Bowbeer, J., Holmes, D., and Lea, D. Java Concurrency in Practice, Addison-Wesley, 2006.
[6]
Hoare, C. A. R. Monitors: An Operating System Structuring Concept. Communications of the ACM, 17(10), 1974.
[7]
IBM Corporation. Performance Inspector, http://perfinsp.sourceforge.net/
[8]
Ishizaki, K., Daijavad, S., and Nakatani, T. Analyzing and Improving Performance Scalability of Commercial Server Workloads on a Chip Multiprocessor, IEEE International Symposium on Workload Characterization (IISWC), 2009.
[9]
Markstrum, S. A., Fuhrer, R. M., and Millstein, T. D. Towards concurrency refactoring for x10, SIGPLAN Note 44(4), 2009.
[10]
Milanova, A., Rountev, A., and Ryder, B. G. Parameterized Object Sensitivity for Points-to Analysis for Java, ACM Transactions on Software Engineering and Methodology (TOSEM), 14(1), 2005.
[11]
Oracle Corporation. Java Platform, Standard Edition 5.0, http://java.sun.com/j2se/1.5.0/
[12]
Oracle Corporation. The Oracle Solaris Studio Performance Tools, http://download.oracle.com/docs/cd/E18659_01/html/821-2763/gkofq.html
[13]
Schäfer, M., Dolby, J., Sridharan, M., Tip, and F., Torlak, E. Correct Refactoring of Concurrent Java Code, In Proceedings of 24th European Conference on Object-Oriented Programming, 2010.
[14]
Schäfer, M., Sridharan, M., Dolby, J., and Tip, F. Refactoring Java Programs for Flexible Locking, In Proceedings of international Conference on Software Engineering, 2011.
[15]
Schmidt, D. C. and Harrison, T. Double-Checked Locking -- An Object Behavioral Pattern for Initializing and Accessing Thread-safe Objects Efficiently, in Pattern Languages of Program Design (R. Martin, F. Buschmann, and D. Riehle, eds.), Addison-Wesley, 1997.
[16]
Sridharan, M., Gopan, D., Shan, L., and Bodík, R. Demand-driven points-to analysis for Java. In Proceedings of Object-Oriented Programming, Systems, Languages, and applications (OOPSLA), 2005.
[17]
T. J. Watson Libraries for Analysis (WALA), http://wala.sf.net/
[18]
Wloka, J., Sridharan, M., and Tip, F. Refactoring for reentrancy, ESEC/FSE '09: In Proceedings of European Software Engineering Conference and Foundations of Software Engineering Symposium, 2009.

Cited By

View all
  • (2024)Automatically Injecting Robustness Statements into Distributed ApplicationsFuture Internet10.3390/fi1611041616:11(416)Online publication date: 10-Nov-2024
  • (2023)An Automatic Transformer from Sequential to Parallel Java CodeFuture Internet10.3390/fi1509030615:9(306)Online publication date: 8-Sep-2023
  • (2020)A survey of concurrency-oriented refactoringConcurrent Engineering10.1177/1063293X2095893228:4(319-330)Online publication date: 8-Oct-2020
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
PADTAD '11: Proceedings of the Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging
July 2011
66 pages
ISBN:9781450308090
DOI:10.1145/2002962
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]

Sponsors

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 17 July 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Java
  2. concurrent library
  3. pointer analysis
  4. refactoring

Qualifiers

  • Research-article

Conference

ISSTA '11
Sponsor:

Upcoming Conference

ISSTA '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)6
  • Downloads (Last 6 weeks)0
Reflects downloads up to 16 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Automatically Injecting Robustness Statements into Distributed ApplicationsFuture Internet10.3390/fi1611041616:11(416)Online publication date: 10-Nov-2024
  • (2023)An Automatic Transformer from Sequential to Parallel Java CodeFuture Internet10.3390/fi1509030615:9(306)Online publication date: 8-Sep-2023
  • (2020)A survey of concurrency-oriented refactoringConcurrent Engineering10.1177/1063293X2095893228:4(319-330)Online publication date: 8-Oct-2020
  • (2019)Automated Refactoring for StampedlockIEEE Access10.1109/ACCESS.2019.29319537(104900-104911)Online publication date: 2019
  • (2018)Specialising Software for Different Downstream Applications Using Genetic Improvement and Code TransplantationIEEE Transactions on Software Engineering10.1109/TSE.2017.270260644:6(574-594)Online publication date: 1-Jun-2018

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media