When Threads share objects in Heap, each thread has to acquire lock(a flag that will be set by the JVM upon request from thread) of the object that it wants to use. In case of method area, threads have to acquire lock of *Class to use its static data.
*Class: In Java, there is a class called Class that represents the actual Class template(not the object)
No comments:
Post a Comment