2009 · 72 citations · 13 references
ComputingComputer ScienceCompilersParallel AlgorithmsParallel ComputingConcurrent ProgrammingSoftware RefactoringAutomated RefactoringGlobal StateGlobal State DetectionGlobal State ManagementMulticore ArchitecturesMulticore SystemsPerformance RefactoringRefactoring
A program is reentrant if distinct executions on distinct inputs cannot affect each other, enabling parallel deployment without extra concurrency control, yet many Java programs are not reentrant because they rely on mutable global state. The study proposes a mostly‑automated refactoring that replaces global state with thread‑local state and runs each execution in a fresh thread to make programs reentrant. The refactoring, implemented in the Eclipse‑based tool Reentrancer, replaces global state with thread‑local state and executes each run in a fresh thread. The refactoring produces programs that are safe for parallel execution, eliminates reentrancy problems in five benchmarks, and yields speedups on a multicore machine for three benchmarks without further code changes.
A program is reentrant if distinct executions of that program on distinct inputs cannot affect each other. Reentrant programs have the desirable property that they can be deployed on parallel machines without additional concurrency control. Many existing Java programs are not reentrant because they rely on mutable global state. We present a mostly-automated refactoring that makes such programs reentrant by replacing global state with thread-local state and performing each execution in a fresh thread. The approach has the key advantage of yielding a program that is obviously safe for parallel execution; the program can then be optimized selectively for better performance. We implemented this refactoring in Reentrancer, a practical Eclipse-based tool. Reentrancer successfully eliminated observed reentrancy problems in five single-threaded Java benchmarks. For three of the benchmarks, Reentrancer enabled speedups on a multicore machine without any further code modification.
13
A survey of software refactoring
Tom Mens, Tom Tourwé · IEEE Transactions on Software Engineering · 2004 · 1.2K citations · Full text
Refactoring object-oriented frameworks
William F. Opdyke · 1992 · 1K citations
Improving the Design of Existing Code
Martin Fowler · 2000 · 238 citations
Program restructuring as an aid to software maintenance
William G. Griswold · 1992 · 158 citations