Consistency Validation Method for Java Fine-Grained Lock Refactoring

Many existing refactoring tools reduce the possibility of lock conflicts and improve the concurrency of the system by reducing lock granularity and narrowing the scope of locked objects. However, such refactorings can lead to changes in concurrent program behavior, introduce concurrency errors, and...

Full description

Saved in:
Bibliographic Details
Main Authors: Yang Zhang, Chunxia Li, Yu Bai
Format: article
Language:EN
Published: IEEE 2021
Subjects:
Online Access:https://doaj.org/article/341c562d6c1f440b9e1fb8aaedf5e6c7
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary:Many existing refactoring tools reduce the possibility of lock conflicts and improve the concurrency of the system by reducing lock granularity and narrowing the scope of locked objects. However, such refactorings can lead to changes in concurrent program behavior, introduce concurrency errors, and often even produce code that does not compile or can be compiled but has changed semantics. To address the problem of changes in concurrent program behavior caused by transferring from coarse-grained locking to fine-grained lock refactoring, a refactoring consistency validation method for fine-grained locking is proposed. Firstly, the types of behavioral changes caused by the existing refactoring engine are analyzed in terms of thread interactions. Secondly, the relevant consistency checking rules are summarized according to the types. Finally, with the help of various program analysis techniques such as call graph analysis, alias analysis and side-effect analysis, the corresponding checking algorithms are designed according to the consistency checking rules to check the consistency of the program before and after refactoring. We implement an automatic validation tool as an Eclipse plug-in. Our approach is verified by ten open-source projects including HSQLDB, Xalan and Cassandra, etc. A total of 1,483 refactoring methods were tested, and 60 inconsistent synchronization behaviors were found, which improved the robustness of refactoring in terms of data dependence and execution order.