Partially thread-safe dictionary

前端 未结 4 1443
野性不改
野性不改 2021-01-20 15:16

I have a class that maintains a private Dictionary instance that caches some data.

The class writes to the dictionary from multiple threads using a

4条回答
  •  自闭症患者
    2021-01-20 15:31

    Review next possibility, just exposes ICollection interface, so in Values() you can return your own implementation. This implementation will use only reference on Dictioanry.Values and always use ReadLock for access items.

提交回复
热议问题