ReaderWriterLockSlim vs. Monitor

后端 未结 3 1654
一向
一向 2020-12-09 06:38

I have an IDictionary implementation that internally holds n other Dictionary and distributes that insertion

3条回答
  •  既然无缘
    2020-12-09 07:32

    I'm no guru, but my guess is that RWLS is more geared towards heavy contention (e.g., hundreds of threads) whereas Monitor is more attuned towards those one-off synchronization issues.

    Personally I use a TimerLock class that uses the Monitor.TryEnter with a timeout parameter.

提交回复
热议问题