libcds icon indicating copy to clipboard operation
libcds copied to clipboard

Why KV list's update() method have no argument with Value to insert ?

Open hvlad opened this issue 4 years ago • 0 comments

Is there any strong reason to not accept Value at update() ?

For example, MichaelKVList::insert() is declared as

        template <typename K, typename V>
        bool insert( K&& key, V&& val )

while there is no update() with V argument.

Yes, we could pass functor that will assing new value to the newly inserted item but there is time window between item insertion and functor execution when another thread could find just inserted item with empty second and all it can do is to spin until second will be initialized.

Why not pass V into update() ? Am I missing something ?

hvlad avatar Jul 25 '21 10:07 hvlad