If a long running operation is defined in a frequently called static method, is it a bottleneck for other threads in an ASP.Net application trying to call the same method?
Does that only apply to methods with the “Synchronized” attribute>?
I’ve searched and can’t seem to find a definitive answer.
No, it’s not going to block any other threads unless the method either acquires a common lock (e.g. due to the
Synchronizedattribute) or calls a synchronized method itself.As Darin says, you could potentially exhaust the thread pool, but I don’t think that’s what your question was worrying about. To be absolutely clear, you can definitely have two threads executing the same static method at the same time, if there isn’t any synchronization involved.