星期三, 一月 02, 2013

Volatile: why prevent compiler reorder code

Prior to Java-5 ,编译器竟然会调整语句的顺序来优化!!!

解释链接:

http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#volatile