计算机科学与探索
計算機科學與探索
계산궤과학여탐색
JOURNAL OF FRONTIERS OF COMPUTER SCIENCE & TECHNOLOGY
2013年
5期
451-459
,共9页
Java%并发%同步%锁分解%重构
Java%併髮%同步%鎖分解%重構
Java%병발%동보%쇄분해%중구
Java%concurrency%synchronization%split lock%refactoring
许多并发程序存在同步粒度过粗的问题,可以通过锁分解等代码重构来逐步演化同步结构,提高程序并行性.然而,手工重构一方面识别重构契机较为困难,另一方面代码转换也容易出错.为克服手工重构中存在的问题,提出了一种针对Java程序的自动锁分解重构方法.它可以根据已有的同步代码,自动识别锁分解重构契机,并对相关代码进行转换.实验表明,该方法可以有效识别真实程序中的可重构代码,并准确实施转换,为并发程序的演化提供支持.
許多併髮程序存在同步粒度過粗的問題,可以通過鎖分解等代碼重構來逐步縯化同步結構,提高程序併行性.然而,手工重構一方麵識彆重構契機較為睏難,另一方麵代碼轉換也容易齣錯.為剋服手工重構中存在的問題,提齣瞭一種針對Java程序的自動鎖分解重構方法.它可以根據已有的同步代碼,自動識彆鎖分解重構契機,併對相關代碼進行轉換.實驗錶明,該方法可以有效識彆真實程序中的可重構代碼,併準確實施轉換,為併髮程序的縯化提供支持.
허다병발정서존재동보립도과조적문제,가이통과쇄분해등대마중구래축보연화동보결구,제고정서병행성.연이,수공중구일방면식별중구계궤교위곤난,령일방면대마전환야용역출착.위극복수공중구중존재적문제,제출료일충침대Java정서적자동쇄분해중구방법.타가이근거이유적동보대마,자동식별쇄분해중구계궤,병대상관대마진행전환.실험표명,해방법가이유효식별진실정서중적가중구대마,병준학실시전환,위병발정서적연화제공지지.
@@@@Many concurrent programs use too coarse synchronizations to protect the accesses of shared data struc-tures. To optimize such synchronizations, people use refactorings, e.g., split lock refactoring, to gradually evolve the synchronization code for better parallelization. However, manually identifying the refactoring opportunities is diffi-cult and code transformations by hand are error-prone. To address the problems of manual refactoring, this paper proposes an automated split lock refactoring approach for Java programs. It can automatically analyze the source code to find the refactoring opportunities and make proper code transformations. The experiment shows that the approach can find effective split lock refactoring opportunities in real projects and correctly transform the refactoring code. This indicates that the approach is helpful for concurrent program evolution.