I do not understand what exactly happen behind the scenes when using static class with static members in multithread environment.
I have a server application where clients very often read-write to SQL db. For that, I have created static class with static members SQLConnection,SLQDataReader etc. But as I understood, static class is just one, shared between threads, so how it deals with multiple requests at the same time? Would not be better just have non static class used for that?
Thanks!
I do not understand what exactly happen behind the scenes when using static class
Share
You should be fine as long as you’re only using static methods and no static fields. Once you decide to use your first static field, you’ll have to worry about thread safety.