Font Size: a A A

Research And Implementation Of Consistency Validation Method For Fine-grained Lock Refactoring

Posted on:2022-08-25Degree:MasterType:Thesis
Country:ChinaCandidate:C X LiFull Text:PDF
GTID:2518306737978879Subject:Computer technology
Abstract/Summary:PDF Full Text Request
Multiple threads competing for access to lock-protected shared resources can affect shared-memory parallelism.Competing locks can cause programs to execute serially and increase context switching overhead,hurting scalability and performance.To improve program parallelism,many existing refactoring tools use methods that reduce the scope of lock-protected shared resources.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 ensure the correctness of refactoring,developers ensure that behavior is maintained by setting preconditions,but automated refactoring tools cannot check all preconditions and cannot fully rely on checking preconditions to complete all consistency validation.Therefore,consistency validation of fine-grained lock refactorings is essential.To address the problem that coarse-grained locking to fine-grained locking refactoring leads to changes in concurrent program behavior,the paper proposes a refactoring consistency validation method for fine-grained locking.First,the types of behavior changes caused by the existing refactoring engine are analyzed in terms of thread interactions.Then,relevant consistency checking rules are summarized to constrain the refactoring operations according to the types.Secondly,call graph analysis is used to collect synchronous call information,alias analysis is performed on variables and locks objects when determining dependencies to make the analysis results accurate and reliable,and side-effect analysis is used to determine the modification of memory units during program execution to increase the basis for determining synchronous behavior changes.Finally,three validation algorithms corresponding to variable overlap validation,condition missing validation,and sequential violation validation are designed according to the consistency validation rules to check the consistency of the program before and after fine-grained lock refactoring and to accurately detect the method of not maintaining synchronization behavior.Based on the above approach,an automatic verification tool was implemented as a plug-in under the Eclipse JDT framework.In the experiments,10 large-scale real applications were selected to verify the tool,and a total of 1483 refactorings for read-write lock separation were verified,and 60 inconsistent synchronization behaviors were found.The experimental results show that the verification tool can effectively check the inconsistent synchronization behavior before and after refactoring and improve the reliability and security of refactoring in terms of data dependency and execution order.
Keywords/Search Tags:Concurrent programs, Refactoring, Fine-grained lock, Consistency validation, Alias analysis, Side-effect analysis
PDF Full Text Request
Related items