-
-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
about a concurrency operation issue #248
Comments
Yes, it sounds like you should definitely use |
Thanks for your response. |
Yes, I think it should work fine, the mutex type does not have to match. |
Thanks for your help. |
"I have a background thread which consumes Kafka messages and then writes them into a parallel_flat_hash_map. Other threads execute find operations. I really want to know if the parallel_flat_hash_map must be protected by a mutex. In our system, we define the map like this: using LocalMap = phmap::parallel_flat_hash_map<uint64_t, std::array<float, N>>, which uses the default NullMutex, and we have not experienced any core dumps or segmentation faults.
However, in the README, I found the following statement: 'If a single hash table is being written to by one thread, then all reads and writes to that hash table on the same or other threads must be protected. For example, given a hash table A, if thread 1 is writing to A, then thread 2 must be prevented from reading from or writing to A.'
I have some confusion, and I am not entirely sure if I understand correctly.
The text was updated successfully, but these errors were encountered: