Static conflict analysis for multi-threaded object-oriented programs
- 9 May 2003
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 38 (5) , 115-128
- https://doi.org/10.1145/780822.781145
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%).This publication has 22 references indexed in Scilit:
- Scientific data repositoriesPublished by Association for Computing Machinery (ACM) ,2003
- Ownership types for safe programmingPublished by Association for Computing Machinery (ACM) ,2002
- Type-based race detection for JavaPublished by Association for Computing Machinery (ACM) ,2000
- Effective synchronization removal for JavaPublished by Association for Computing Machinery (ACM) ,2000
- How to make a correct multiprocess program execute correctly on a multiprocessorIEEE Transactions on Computers, 1997
- Non-concurrency analysisPublished by Association for Computing Machinery (ACM) ,1993
- Concurrency analysis in the presence of procedures using a data-flow frameworkPublished by Association for Computing Machinery (ACM) ,1991
- Efficient and correct execution of parallel programs that share memoryACM Transactions on Programming Languages and Systems, 1988
- A general-purpose algorithm for analyzing concurrent programsCommunications of the ACM, 1983
- MonitorsCommunications of the ACM, 1974