Is it possible to implement lock free map in C++

后端 未结 6 917
再見小時候
再見小時候 2020-12-02 23:33

We are developing a network application based C/S, we find there are too many locks adding to std::map that the performance of server became poor.

I wonder if it is

6条回答
  •  不思量自难忘°
    2020-12-03 00:18

    HashMap would suit? Have a look at Intel Threading Building Blocks, they have an interesting concurrent map. I'm not sure it's lock-free, but hopefully you're interested in good multithreading performance, not particularly in lock-freeness. Also you can check CityHash lib

    EDIT:

    Actually TBB's hash map is not lock-free

提交回复
热议问题