- 浏览: 7802 次
- 性别:
- 来自: 太原
最新评论
-
冲杯茶喝:
你试过吗,文章中的代码,在windows下没有出现reorde ...
volatile关键词的原理与用途 -
ITChaser:
不好意思,同一篇文章中的内容,只截取了我感兴趣的专题放上来,有 ...
volatile关键词的原理与用途 -
yumi301:
因为x和v赋值的顺序可能被reorder
—————————— ...
volatile关键词的原理与用途 -
eastone:
多CPU机器上,这东西比同步还重要
volatile关键词的原理与用途
文章列表
首先引用一段对Spring Container Hierarchy的理解
引用The Spring framework is used as a general application framework. The objects making up the application are being wired up by the Spring framework based on a number of XML configuration files, generally one per layer. The Spring ContextSingletonBeanFactoryLocato ...
- 2009-08-11 15:17
- 浏览 2050
- 评论(0)
简言之,XWork-Spring 的 Container Hierarchy 按照从 parent 到 child 的顺序依次为:
application-scope containers,session-scope containers , request-scope containers。详细解释如下(源自:http://jira.opensymphony.com/browse/XOP-1):
引用The following describes how the spring container hierarchy is constructed.
ContextLoaderListene ...
- 2009-08-11 14:43
- 浏览 1492
- 评论(0)
本文的思想来源于:
Jeremy Manson and Brian Goetz, 《JSR 133 (Java Memory Model) FAQ》, February 2004, http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#synchronization
(1) 在一些情况下,对程序变量(对象实例变量、静态变量、数组元素)进行acces ...
本文的思想来源于:
Jeremy Manson and Brian Goetz, 《JSR 133 (Java Memory Model) FAQ》, February 2004, http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#synchronization
volatile字段被用来在线程之间communicate state。任意线程所read的volatile字段的值都是最新的。
原因有四:
(1) 编译器和JVM会阻止将volatile字段的值放入处理器寄存器(register);
...
本文的思想来源于:
Jeremy Manson and Brian Goetz, 《JSR 133 (Java Memory Model) FAQ》, February 2004, http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#synchronization
"double-checked locking"经常被用于Singleton模型中实现lazy load,典型的"double-checked locking"代码如下所示:
// double-checke ...
- 2009-07-29 13:13
- 浏览 1208
- 评论(0)