Java同步线程模型分析与改进  被引量:6

Analysis and Improvement for Synchronous Thread Model Based on Java

在线阅读下载全文

作  者:陈文宇[1] 陈福[1] 余盛季[1] 孙世新[1] 

机构地区:[1]电子科技大学计算机科学与工程学院,成都610054

出  处:《电子科技大学学报》2010年第3期430-434,共5页Journal of University of Electronic Science and Technology of China

基  金:国家863计划(2007AA01Z131);电子科技大学青年基金(L08010601JX0754)的资助

摘  要:目前普遍采用急救包(Band-Aid)类库的方式解决Java线程模型存在的同步问题,但类库中的代码很难或无法实现优化。该文针对Java同步线程模型的缺陷,扩展synchronised关键字语法,使它支持多个参数和能接受一个超时说明;重新定义wait()使它返回一个boolean变量来解决超时检测问题;通过扩展语法方法解决了同步问题,以确保使用Java线程所开发的程序的稳定、可靠和可优化。Java supports threading at language level.In order to synchronize,Java provides keyword "synchronized" and mechanisms like wait() for Object,however,the potential imperfectness of the mechanisms may trigger unpredictable results.Currently,"Band Aid" class library is often used to solve the synchronize problem of Java thread model,but it is hard to optimize the class library.The paper discusses drawbacks of Java threading mechanism,extends the grammar of synchronized keyword for accepting multiple parameters and a timeout callback;redefines wait() method for returning a boolean variable to solve the timeout detection issue.The synchronize issue is solved by using syntax extension methods to guarantee the stability,reliability and optimized attributes of the programs developed by Java threads.

关 键 词:双检锁 Java内存模型 Java线程模型 同步 

分 类 号:TP316[自动化与计算机技术—计算机软件与理论] TP309[自动化与计算机技术—计算机科学与技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象