摘要
针对Java语言中Thread和Executor两种线程机制在线程管理模式、代码编写量和性能上的不同,提出了一种面向Java多线程机制的软件自动重构方法,该方法可以实现Thread和Executor之间的自动重构转换,进而帮助程序员选择更适合的线程机制.在Eclipse JDT环境下实现了从Thread到Executor的自动重构工具Rethreader.在实验中,使用Rethreader对JGF基准测试程序套件中的Series、Crypt、Lufact、Sparsematmult和Montecarlo等基准程序进行了重构测试,实验结果表明,Rethreader可以在小于1s的短时间内实现从Thread到Executor的转换.
Java thread mechanisms,such as Thread and Executor,are different in the thread management pattern,code and the performance.To implement the automated refactoring between different thread mechanism and help programmers to choose the right thread mechanism,an automated refactoring method was proposed for Java thread mechanism able refactoring between Thread and Executor.To test the validity of the method,an automated refactoring tool named Rethreader was developed in Eclipse JDT.In the experimentation,several programs in the Java Grande Form(JGF)were tested,including Series,Crypt,Lufact,Sparsematmult and montecarlo.The experimental results show that the Rethreader can successfully implement the automatic refactoring from Thread to Executor within 1 s.
作者
张杨
柳晨光
张冬雯
郑琨
郑雅洁
ZHANG Yang;LIU Chen-guang;ZHANG Dong-wen;ZHENG Kun;ZHENG Ya-jie(School of Information Science and Engineering,Hebei University of Science and Technology, Shijiazhuang,Hebei 050000,China)
出处
《北京理工大学学报》
EI
CAS
CSCD
北大核心
2018年第11期1149-1155,共7页
Transactions of Beijing Institute of Technology
基金
国家自然科学基金资助项目(61440012)
河北省自然科学基金资助项目(F2016208007)
河北省自然科学基金重点基础研究专项(18960106D)
河北省高等学校青年拔尖人才计划项目(BJ2014023)
河北省教育厅科学研究项目(QN2016139)