Abstract

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.

Highlights

  • Locks are used to control access to shared resources by multiple threads and are one of the most commonly used synchronization methods, but the use of locks can lead to lock contention

  • There have been some works on concurrent program refactoring to detect inconsistent behavior before and after refactoring [13], [14], but the correctness verification in fine-grained lock refactoring has yet to be studied in depth

  • To check the synchronization change of behavior caused by fine-grained lock refactoring, the paper proposes a method to check the consistency of refactoring

Read more

Summary

INTRODUCTION

Locks are used to control access to shared resources by multiple threads and are one of the most commonly used synchronization methods, but the use of locks can lead to lock contention. Developers are usually encouraged to use regression testing techniques to ensure that refactoring does not change the program behavior [2] This approach highlights its effectiveness when only very few threads are scheduled in a concurrent environment. There have been some works on concurrent program refactoring to detect inconsistent behavior before and after refactoring [13], [14], but the correctness verification in fine-grained lock refactoring has yet to be studied in depth. To check the synchronization change of behavior caused by fine-grained lock refactoring, the paper proposes a method to check the consistency of refactoring. Experimental results show that the method proposed can effectively discover the inconsistent synchronization behavior caused by fine-grained lock refactoring.

RELATED WORKS
CONSISTENCY VALIDATION RULES
IMPLEMENTION
VIII. CONCLUSION
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call