Comments (4)
When I try to use phmap::parallel_node_hash_map<uint32_t, std::vector<uint32_t>>, I got nearly the same error.
from parallel-hashmap.
Hi @HatakeKakaxi , when using a parallel_node_hash_map
from multiple threads, it is not safe to use iterators, or references returned by operator[]()
. If you provide a full example of what you are doing, I can suggest how to use extended APIs to solve your issue.
from parallel-hashmap.
Hi @HatakeKakaxi , when using a
parallel_node_hash_map
from multiple threads, it is not safe to use iterators, or references returned byoperator[]()
. If you provide a full example of what you are doing, I can suggest how to use extended APIs to solve your issue.
Thank you, @greg7mdp. Here is my example. I defined a phmap::parallel_node_hash_map<uint32_t, std::vector<uint32_t>> seed_index_pos
in the main thread, and modify this parallel_node_hash_map
in other threads. I use a boost::thread_pool
with 8 threads to modify this hash map. The modication is just like this:
seed_index_pos[index].emplace_back(1);
Did you mean that it's not safe to use the operator[]()
? Which APIs should I use ?
from parallel-hashmap.
Did you mean that it's not safe to use the
operator[]()
?
This is correct, it is not safe in a multithreaded context.
Which APIs should I use ?
You should most likely use lazy_emplace_l
. Please see mt_word_counter.cc
example in the examples
directory.
from parallel-hashmap.
Related Issues (20)
- Suggestion: lazy_emplace_l without last argument HOT 12
- Unused variable warning HOT 2
- question about performance of `at(...)` HOT 4
- Iteration Order Differs on Arm64 Architecture HOT 4
- Very minor optimization: _mm_abs_epi8 instead of _mm_sign_epi8 HOT 1
- Slow in a specific case HOT 20
- asan build on linux failed with memory error HOT 3
- In template: constexpr variable 'kFirst' must be initialized by a constant expression HOT 6
- phmap_dump saving a lot more than needed HOT 4
- Thread safe way to check existence of items HOT 8
- is it possible to miss the necessary .cmake in the conda packaging? HOT 1
- nvc++: integer conversion resulted in a change of sign HOT 9
- Need a tag about `reserve` bug HOT 3
- Need help speeding up large hash map HOT 6
- merging maps HOT 8
- Release memory after shrinking HOT 6
- Memory not reclaimed after calling map.clear() HOT 4
- Ability to reset the inner sub map HOT 64
- issue under mac? HOT 6
- hash_multimap HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parallel-hashmap.