ReaderWriterLock vs lock{}

后端 未结 7 2167
死守一世寂寞
死守一世寂寞 2020-11-30 21:38

Please explain what are the main differences and when should I use what.
The focus on web multi-threaded applications.

7条回答
  •  遥遥无期
    2020-11-30 22:30

    It is true that ReaderWriterLockSlim is FASTER than ReaderWriterLock. But the memory consumption by ReaderWriterLockSlim is outright outrageous. Try attaching a memory profiler and see for yourself. I would pick ReaderWriterLock anyday over ReaderWriterLockSlim.

提交回复
热议问题