On Fri, Mar 6, 2015 at 7:00 PM, Niall Douglas
Move construction of the map != move construction of the buckets.
Okay. I am trying to achieve move construction in the same spirit. And
I am piggybacking on Niall's implementation of _rehash().
concurrent_unordered_map(concurrent_unordered_map &&old_map)
BOOST_NOEXCEPT :
_hasher(std::move(old_map._hasher)),
_key_equal(std::move(old_map._key_equal)),
_allocator(std::move(old_map._allocator)),
_max_load_factor(std::move(old_map._max_load_factor)),
_min_bucket_capacity(std::move(old_map._min_bucket_capacity))
{
typedef decltype(_rehash_lock) rehash_lock_t;
lock_guard
Old buckets go into a fixed size ring buffer, and get deleted eventually.
I couldn't really figure out where the ring buffer is which you are mentioning here. What am I missing? And another question, when I use the above implementation of move constructor and later call empty() on the newly created object, I land in a segfault. I see that the empy() checks on if the lock state is 2 and continues to check the next bucket. But, I think here I have all buckets set to lock state 2. Why did the swap I performed with the tempbuckets and oldmap._buckets not help me? Any pointers will be really helpful. Thanks, Amarnath