- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm reading the source code of the concurrent_unordered_map, and found it's interface unsafe_bucket_size is designed with non-const function,
so just curious is this by design? i guess if some body invoke this method in a const method, the compiler will not allow that.
https://github.com/intel/tbb/blob/tbb_2020/include/tbb/internal/_concurrent_unordered_impl.h
// Bucket interface - for debugging size_type unsafe_bucket_count() const { return my_number_of_buckets; } size_type unsafe_max_bucket_count() const { return segment_size(pointers_per_table-1); } size_type unsafe_bucket_size(size_type bucket) { // ====> non const? size_type item_count = 0; if (is_initialized(bucket)) { raw_iterator it = get_bucket(bucket); ++it; for (; it != my_solist.raw_end() && !it.get_node_ptr()->is_dummy(); ++it) ++item_count; } return item_count; } size_type unsafe_bucket(const key_type& key) const { sokey_t order_key = (sokey_t) my_hash_compare(key); size_type bucket = order_key % my_number_of_buckets; return bucket; }
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for the delayed response.
unsafe_bucket_size is const in oneTBB so the issue is fixed in the latest release:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We will no longer respond to this thread.
If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.
Thanks,
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page