ConcurrentHashMap for c++

后端 未结 3 1272
清歌不尽
清歌不尽 2020-12-19 01:04

Is there any ConcurrentHashMap for c++ implementation or something of similar anywhere?

I can\'t understand why multithreading in c++ is so hard than Java!

3条回答
  •  离开以前
    2020-12-19 01:36

    Threads arent really supported in C++ so there isnt anything in the standard about thread safe containers. People have obviously made them before.

    I think this thing from Intel may help http://www.threadingbuildingblocks.org/

    I have not used it myself yet so no guarentees.

    You can also just wrap any container in your own class with a semaphore to make it thread safe.

    Good luck.

提交回复
热议问题