Can I (safely) use the ThreadStatic attribute in ADO.NET data services?

I want to store data in a stream in the ADO.NET data service. Is it possible to use the ThreadStatic attribute for my static variable depending on the thread, or am I having problems? My concern is that my ThreadStatic variables will not collect garbage after completing the request and thread.

If there is a better way to do what I'm trying to do, please let me know. It just looks like the simplest solution.

Any information would be very helpful, thanks!

+3
source share
2 answers

, DataService, , , IsThreadPoolThread = true, [ThreadStatic] , ( ).

+3

, ThreadStatic, , , , , . , , , .

0

Source: https://habr.com/ru/post/1723238/


All Articles