unordered_map thread safety

后端 未结 7 726
故里飘歌
故里飘歌 2020-11-30 02:12

I am changing a single thread program into multi thread using boost:thread library. The program uses unordered_map as a hasp_map for lookups. My question is..

At on

7条回答
  •  青春惊慌失措
    2020-11-30 03:04

    You can use concurrent_hash_map or employ an mutex when you access unordered_map. one of issue on using intel concurrent_hash_map is you have to include TBB, but you already use boost.thread. These two components have overlapped functionality, and hence complicate your code base.

提交回复
热议问题