[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Do static methods cause a bottleneck?



A discussion came up at work today. If a class only provides static
methods and only final static data members (just for storing read only
info like a connection string), will this create a bottleneck? Someone
was suggesting that sharing the static methods of the class would cause
each thread accessing the code to have to obtain the monitor on the
class before being able to execute the method. Is this the case? None
of the methods are synchronized, but each method is independent of
other methods. It's basically a utility class.  Would I be better
served to instantiate an object for each thread that is accessing the
methods?  Anyone have any input on this? I'm guessing the JVM
specification probably goes into detail on this topic, but I couldn't
find it.

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/