Refactoring Sequential Java Code for Concurrency via Concurrent Libraries

Parallelizing existing sequential programs to run efficiently on multicores is hard. The Java 5 packagejava.util.concurrent (j.u.c.) supports writing concurrent programs: much of the complexity of writing threads-safe and scalable programs is hidden in the library. To use this package, programmers...

Full description

Bibliographic Details
Main Authors: Ernst, Michael D., Marrero, John, Dig, Danny
Other Authors: Michael Ernst
Published: 2008
Subjects:
Online Access:http://hdl.handle.net/1721.1/42841
_version_ 1811081458598543360
author Ernst, Michael D.
Marrero, John
Dig, Danny
author2 Michael Ernst
author_facet Michael Ernst
Ernst, Michael D.
Marrero, John
Dig, Danny
author_sort Ernst, Michael D.
collection MIT
description Parallelizing existing sequential programs to run efficiently on multicores is hard. The Java 5 packagejava.util.concurrent (j.u.c.) supports writing concurrent programs: much of the complexity of writing threads-safe and scalable programs is hidden in the library. To use this package, programmers still need to reengineer existing code. This is tedious because it requires changing many lines of code, is error-prone because programmers can use the wrong APIs, and is omission-prone because programmers can miss opportunities to use the enhanced APIs. This paper presents our tool, CONCURRENCER, which enables programmers to refactor sequential code into parallel code that uses j.u.c. concurrent utilities. CONCURRENCER does not require any program annotations, although the transformations are very involved: they span multiple program statements and use custom program analysis. A find-and-replace tool can not perform such transformations. Empirical evaluation shows that CONCURRENCER refactors code effectively: CONCURRENCER correctly identifies and applies transformations that some open-source developers overlooked, and the converted code exhibits good speedup.
first_indexed 2024-09-23T11:47:00Z
id mit-1721.1/42841
institution Massachusetts Institute of Technology
last_indexed 2024-09-23T11:47:00Z
publishDate 2008
record_format dspace
spelling mit-1721.1/428412019-04-10T09:16:07Z Refactoring Sequential Java Code for Concurrency via Concurrent Libraries Ernst, Michael D. Marrero, John Dig, Danny Michael Ernst Program Analysis program transformations concurrency refactoring library Parallelizing existing sequential programs to run efficiently on multicores is hard. The Java 5 packagejava.util.concurrent (j.u.c.) supports writing concurrent programs: much of the complexity of writing threads-safe and scalable programs is hidden in the library. To use this package, programmers still need to reengineer existing code. This is tedious because it requires changing many lines of code, is error-prone because programmers can use the wrong APIs, and is omission-prone because programmers can miss opportunities to use the enhanced APIs. This paper presents our tool, CONCURRENCER, which enables programmers to refactor sequential code into parallel code that uses j.u.c. concurrent utilities. CONCURRENCER does not require any program annotations, although the transformations are very involved: they span multiple program statements and use custom program analysis. A find-and-replace tool can not perform such transformations. Empirical evaluation shows that CONCURRENCER refactors code effectively: CONCURRENCER correctly identifies and applies transformations that some open-source developers overlooked, and the converted code exhibits good speedup. 2008-09-30T19:15:06Z 2008-09-30T19:15:06Z 2008-09-30 http://hdl.handle.net/1721.1/42841 MIT-CSAIL-TR-2008-057 Creative Commons Attribution 3.0 Unported http://creativecommons.org/licenses/by/3.0/ 12 p. application/pdf application/postscript
spellingShingle program transformations
concurrency
refactoring
library
Ernst, Michael D.
Marrero, John
Dig, Danny
Refactoring Sequential Java Code for Concurrency via Concurrent Libraries
title Refactoring Sequential Java Code for Concurrency via Concurrent Libraries
title_full Refactoring Sequential Java Code for Concurrency via Concurrent Libraries
title_fullStr Refactoring Sequential Java Code for Concurrency via Concurrent Libraries
title_full_unstemmed Refactoring Sequential Java Code for Concurrency via Concurrent Libraries
title_short Refactoring Sequential Java Code for Concurrency via Concurrent Libraries
title_sort refactoring sequential java code for concurrency via concurrent libraries
topic program transformations
concurrency
refactoring
library
url http://hdl.handle.net/1721.1/42841
work_keys_str_mv AT ernstmichaeld refactoringsequentialjavacodeforconcurrencyviaconcurrentlibraries
AT marrerojohn refactoringsequentialjavacodeforconcurrencyviaconcurrentlibraries
AT digdanny refactoringsequentialjavacodeforconcurrencyviaconcurrentlibraries