MemoryCache Thread Safety, Is Locking Necessary?

前端 未结 7 650
你的背包
你的背包 2020-12-07 18:34

For starters let me just throw it out there that I know the code below is not thread safe (correction: might be). What I am struggling with is finding an implementation that

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-07 18:55

    Check out this link: http://msdn.microsoft.com/en-us/library/system.runtime.caching.memorycache(v=vs.110).aspx

    Go to the very bottom of the page (or search for the text "Thread Safety").

    You will see:

    ^ Thread Safety

    This type is thread safe.

提交回复
热议问题