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. [color=red]If not, it acts as an instance method.[/color]
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. [color=red]If not, it acts as an instance method.[/color]