Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 3
    The cost of context switching the threads will far exceed any difference due to static vs non-static. Commented Nov 11, 2016 at 11:01
  • 1
    I have no idea what you might even be implying. The performance hit of what exactly? How is it different to call an instance method vs. static method? Commented Nov 11, 2016 at 11:04
  • @MarkoTopolnik There is only one instance of the static method of a class in memory. If all threads are invoking this static method around same time, there might be waiting time for remaining threads. Commented Nov 12, 2016 at 2:17
  • 1
    Ok, then your question comes from basic misunderstanding. There's only one instance of any method and any number of threads may execute it at any time. Only locks cause mutual exclusion. Commented Nov 12, 2016 at 5:57