Monday, October 5, 2009

Refactoring sequential Java code for concurrency via concurrent libraries

I truly enjoyed reading this paper because it is simple, well organized and easy to follow. The authors describe a rafactoring tool that enables developers to convert sequential java code to parallel code using the java.util.concurrent(j.u.c) package. The j.u.c package provides utility classes for concurrent programming. To use the tool, the programmer selects the target piece of code, and applies the appropriate refactoring. This allows the program to be incrementally transformed to a parallel program using a series of refactorings under the control of the programmer. While not perfect yet, I think this tool has a great advantage over manual refactoring. The paper presents pretty convincing details how the tool achieved better results compared to manual refactorings done on the same projects.
The tool is not completely automated as the programmer needs to select a piece of code and target it with the rafactorings. This still leave room for omission. A fully automated tool will probably find more areas suited for parallelism than a programmer. So, logical extensions opportunities for the Concurrencer include fully automation and the support for additional refactorings.

Parallel refactoring tools are great, but for some cases, it is probably more difficult to retrofit concurrency into a sequential program than to re-design for parallelism. If a team has the time and the resources I believe they should redesign. It will be easier and more parallelism will be achieved that way instead of being constrained by a sequential design that was done without taking into account parallelism.

No comments:

Post a Comment