- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all, I have two very simple questions.
The first is this: am I missing the doxygen documentation for concurrent_hash_map? The only documentation I've seen is this: http://www.threadingbuildingblocks.org/docs/help/tbb_userguide/concurrent_hash_map.htm
The second is: how can I reserve memory? The std::unordered_map gives me std::unordered_map::reserve, but TBB's implementation seems to provide only a protected method... and I'd really like to avoid subclassing for just this simple task. But maybe there's a way I'm not aware of.
Thanks!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How about using rehash() instead?
(Added) There's also a Reference Manual, but the doxygen content unfortunately hides under tbb::interface5::concurrent_hash_map (so you always have to check those interface... versions).
(Added) For completeness: you reserve for "buckets", not for "memory" (there will still be allocations for elements); don't overlook the constructor that allows you to reserve in advance; don't subclass concurrent_hash_map in the hope of using reserve() as in std::unordered_map (it doesn't have the same effect).
(2014-06-18 Correction: ordered_map->unordered_map)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Raf Schietekat wrote:
How about using rehash() instead?
(Added) There's also a Reference Manual, but the doxygen content unfortunately hides under tbb::interface5::concurrent_hash_map (so you always have to check those interface... versions).
Thanks, Raf, I didn't see that! I wonder why it is hidden down there, honestly, I never looked into those namespaces...
Raf Schietekat wrote:
(Added) For completeness: you reserve for "buckets", not for "memory" (there will still be allocations for elements); don't overlook the constructor that allows you to reserve in advance; don't subclass concurrent_hash_map in the hope of using reserve() as in std::ordered_map (it doesn't have the same effect).
Ok, I won't subclass it.
Thanks, as always you're really helpful!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page