| Author |
Synchronized static methods and plain synchronized methods
|
Kunaal A Trehan
Ranch Hand
Joined: Feb 04, 2004
Posts: 63
|
|
Hi Consider a case where I have 2 methods,1 is synchronized and other is static synchronized. Both these methods are called from the run mthd(). Lets suppose one thread is calling static synchronized method.Its still under process. Can another thread call the other non static synchronized method Rgds Kunal
|
 |
David Harkness
Ranch Hand
Joined: Aug 07, 2003
Posts: 1646
|
|
|
Synchronized static methods lock the single Class instance while instance (non-static) methods lock the instance of the class on which they are executed. Thus, neither will block the other.
|
 |
 |
|
|
subject: Synchronized static methods and plain synchronized methods
|
|
|