How to use an AppDomain to limit a static class' scope for thread-safe use?

后端 未结 6 2079
我在风中等你
我在风中等你 2021-01-05 10:31

I have been bitten by a poorly architected solution. It is not thread safe!

I have several shared classes and members in the solution, and during development all

6条回答
  •  萌比男神i
    2021-01-05 11:06

    If you have shared statics that are conflicting with each other, then you might want to try adding [ThreadStatic] attribute to them. This will make them local to each thread. That may solve your problem in the short term. A correct solution would be to simply rearchitect your stuff to be thread-safe.

提交回复
热议问题