[MT]: I read something about static methods using a class level lock (by default) and so only one method can execute them at a time That would be true for static
synchronized methods. It's not true for static methods in general.
[MT]: (they are thread safe). Well, in my opinion, "thread safe" is a horribly misused term anyway, and no one should assume that just because a method is
synchronized it's also
thread safe. Many people have written unsafe code with Vector, for example.
[MT]: Then, again someone suggested: there is nothing inherent in static methods that makes them thread safe. This is true.
[MT]: Questions:
1. Did i misinterpret thread safety and the stuff about static methods? Yes.
[MT]: 2. Is my definition of thread safety distorted? Yes, but mostly in a minor, straightforward way, pointed out above.
[MT]: 3. if you can share a link, that would throw some light on the above mentioned, i'd be obliged. Well, the correction in this thread was pretty minor, I think, and was probably present in the original sources you learned from - whatever those may be. For more detailed explanations I know are not free - try
Java Concurrency in Partice, or
Java Threads. Or a few chapters in
Effective Java. Sorry I don't have a better free link offhand.
[ October 23, 2008: Message edited by: Mike Simmons ]