2019年12月15日 星期日

ThreadStatic

https://www.c-sharpcorner.com/article/overview-of-threadstatic-attribute-in-c-sharp/

Here, we initialized ThreadStatic field with 10. When we run it, only the main (first) thread’s field will be having 10. All the rest of the threads will have a default value of 0.


https://github.com/imrexhuang/HelloThreadStatic 


ThreadStaticAttribute 類別
https://docs.microsoft.com/zh-tw/dotnet/api/system.threadstaticattribute?view=netframework-4.8 


Using ThreadStatic and ThreadLocal
https://putridparrot.com/blog/using-threadstatic-and-threadlocal/ 

沒有留言:

張貼留言