C# : What if a static method is called from multiple threads?

Posted by Holli on Stack Overflow See other posts from Stack Overflow or by Holli
Published on 2010-06-14T13:38:48Z Indexed on 2010/06/14 13:42 UTC
Read the original article Hit count: 263

Filed under:
|

In my Application I have a static method that is called from multiple threads at the same time. Is there any danger of my data being mixed up?

In my first attempt the method was not static and I was creating multiple instance of the class. In that case my data got mixed up somehow. I am not sure how this happens because it only happens sometimes. I am still debugging. But now the method is static on I have no problems so far. Maybe it's just luck. I don't know for sure.

© Stack Overflow or respective owner

Related posts about c#

Related posts about multithreading