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.
Variables declared inside methods (with the possible exception of "captured" variables) are isolated, so you won't get any inherent problems; however, if your static method accesses any shared state, all bets are off.
Examples of shared-state would be:
If you have shared state, you must either:
whatever.SomeData
repeatedly, you read whatever.SomeData
once into a local variable, and then just use the variable - note that this only helps for immutable state!)