I want to know is it ok that a static method gets called from multiple projects maybe at same time?
Well it depends on what the method does. You need to take responsibility for making sure it's okay to call it from multiple threads at the same time. (Whether the callers are in the same project is almost always completely irrelevant.)
So long as you don't modify any shared state in a dangerous way - e.g. adding to a List<T>
without any synchronization - you should be fine. It all depends on what you're doing though.
Each call will be independent in terms of having a separate set of parameters and local variables. Now if some of those parameters refer to objects which are visible to other threads, that's a different matter... but we can't tell that from your question.
Note that the use of Thread.Sleep
here is pretty much irrelevant. Admittedly if you have some synchronization (e.g. via lock
) then it would be pretty unpleasant for the thread which owns a lock to then sleep...