Monday, April 3, 2006 07:36 AM
Synchronization is (partly) all about monitors. Each synchronization step is associated with a monitor. Monitors are thingies like very small toilets only one person can access at a time.
Static synchronized methods have their monitor associated with the class itself. That's not fully precise but it'll suffice. Synchronized instance methods have their monitor associated with the instance Object. Two monitors (the very small toilets) cannot be owned (be synchronized upon) by two different threads at the same time, even when bare need is at hand (beershit or the like).
This means that: when a Thread enters a static synchronized method of a given class, then no other Thread can enter another static synchronized method of that class. But other threads might execute any non-synchronized method, or a synchronized instance method.
There are many tutorials and explanations to be found on the web. Try "java+synchronization+tutorial" in google. And if you want the utmost precise, accurate and reliable picture, check the JLS