Why slim reader/writer exclusive lock outperformance the shared one?

前端 未结 3 752
遥遥无期
遥遥无期 2021-02-04 15:49

I have tested the performance of slim reader/writer lock under windows 7 using the codefrom Windows Via C/C++.

The result surprised me that the exclusive lock o

3条回答
  •  一生所求
    2021-02-04 16:03

    Speculation:

    Exclusive lock is the simpler case. Shared locks enable parallelism but need to deal with starvation possibilities so there's additional overhead.

提交回复
热议问题