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
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- GNU Software. gcj - The GNU compiler for the Java programming language. http://gcc.gnu.org/java, 2000.]]Google Scholar
- 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 Scholar
Digital Library
- C. Hoare. Monitors: An operating system structuring concept. Communications of the ACM, 17(10):549--557, Oct. 1974.]] Google Scholar
Digital Library
- Java Grande Forum. Multi-threaded benchmark suite. http://www.epcc.ed.ac.uk/javagrande/, 1999.]]Google Scholar
- 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 Scholar
Digital Library
- S. Masticola and B. Ryder. Non-concurrency analysis. In Proc. Symp. Principles and Practice of Parallel Programming (PPoPP'93), pages 129--138, 1993.]] Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- M. Rinard. Analysis of multithreaded programs. In Proc. Static Analysis Symp. (SAS'01), July 2001.]] Google Scholar
Digital Library
- E. Ruf. Effective synchronization removal for Java. In Proc. Conf. Programming Language Design and Implementation (PLDI'00), pages 208--218, June 2000.]] Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- R. Taylor. A general purpose algorithm for analyzing concurrent programs. Communications of the ACM, 26(5):362--376, May 1983.]] Google Scholar
Digital Library
- The Standard Performance Evaluation Corporation. SPEC JVM98 Benchmarks. http://www.spec.org/osg/jvm98, 1996.]]Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Static conflict analysis for multi-threaded object-oriented programs






Comments