BOOST: recursive shared_mutex?

后端 未结 5 2057
傲寒
傲寒 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:57

    have a look at this thread and this excellent explanation why shared_mutex is bad idea in general. so if you don't agree that recursive_mutex is bad idea too, just use it without any shariness because it cannot give you any performance boost. you'll receive even a bit cleaner code w/o any major changes.

    I tried to use shared_mutex in my project to lock highly contested map when many threads often read data and rarely modify it. received a bit worse performance results

提交回复
热议问题