读书人

java 静态方法同步有关问题

发布时间: 2013-03-25 15:43:04 作者: rapoo

java 静态方法同步问题
java 静态方法同步问题
Every method of java will have a stack, and every invokation on that method will have it's own 'stack frame'. So the locale data of one method invokation will not affect others.
Please do not confuse 'synchronization' with 'atomic'.
If one static method is synchronized, JVM will use the Class as the lock. If not, it acts as an instance method.

读书人网 >编程

热点推荐