基于Servlet的线程安全问题的研究  

Research of Thread Safety Problem Based on Servlet

在线阅读下载全文

作  者:刘冰[1] 

机构地区:[1]达州职业技术学院信息工程系,四川达州635001

出  处:《计算机时代》2010年第5期17-19,共3页Computer Era

摘  要:由于Servlet在服务器端事务处理方面的优异表现,在许多的Web应用中,它仍然是不可或缺的。在默认情况下,Servlet是以单实例多线程方式进行工作的,这就要求在用Servlet构建Web应用时重点考虑其线程的安全性。文章从一个实际的Servlet用例入手,就安全性问题展开了深入的分析,并得出其中实例变量不正确的使用是造成Servlet线程不安全的重要原因的结论,同时还就这一问题给出了几个供参考的解决方案。Because of Servlet's good performance in server-side transaction processing, it is still indispensable in many Web applications. Servlet works in the way of single instance and multiple threads by default, so the safety of its threads should be considered emphatically in using Servlet to construct Web applications. Starting with a real Servlet case, the safety problem is deeply analyzed, and the conclusion is drawn that the incorrect use of instance variable is the significant cause of making Servlet threads unsafe, also several solutions to this problem are given for reference.

关 键 词:SERVLET 线程 安全性 内存模型 实例变量 

分 类 号:TP393.09[自动化与计算机技术—计算机应用技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

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