BOOST: recursive shared_mutex?

后端 未结 5 1970
傲寒
傲寒 2021-02-13 04:16

Seems that Boost\'s shared_mutex is non recursive.. Is there anyway around this? (without re implementing the whole stuff)

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-13 04:54

    I partially disagree with Andy that shared_mutex is a bad idea because it depends on your design i.e. how do you use it in your program. I believe that if you do long frequent reads with shared mutex it can bring you more efficient performance than if you would have used simple mutex for short more frequent locks for reading with rare writings. So shared_mutex is a way to do something long simultaneously. And I don't think that a long lock is a bad design in this case.

    Do you support me or I am wrong?

提交回复
热议问题