Static method behaviors in multiple threads is the same to normal method that used from a class instance. The difference is that we can call it from class directly. Static method will create its own copies for its local variables because each thread has its own stack. The only things concerned in multiple threads are static fields, static objects. If the objects can be accessed from multiple threads, it need lock or synchronize.
References:
References:
No comments:
Post a Comment