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!
There is tbb::concurrent_hash_map and tbb::concurrent_unordered_map of Intel TBB
There is a new open-source library called junction
available that contains several new concurrent maps.
https://github.com/preshing/junction
It’s BSD-licensed, so you can use the source code freely in any project, for any purpose.
Find more detail in this blogpost.
Thanks to the author Jeff.
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.