From 8bd1bcf5de524ebd2a29edda58036cd5467edbda Mon Sep 17 00:00:00 2001 From: joaquintides Date: Mon, 4 Dec 2023 11:26:35 +0100 Subject: [PATCH] gotten rid of wait_for_epochs in insertion --- include/boost/unordered/detail/foa/concurrent_table.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/unordered/detail/foa/concurrent_table.hpp b/include/boost/unordered/detail/foa/concurrent_table.hpp index 37bfda14..7be7218e 100644 --- a/include/boost/unordered/detail/foa/concurrent_table.hpp +++ b/include/boost/unordered/detail/foa/concurrent_table.hpp @@ -1492,7 +1492,7 @@ private: for(;;){ startover: - boost::uint32_t counter=insert_counter(pos0); + boost::uint32_t counter=++insert_counter(pos0); if(unprotected_visit( access_mode,k,pos0,hash,std::forward(f)))return 0; @@ -1510,8 +1510,8 @@ private: /* slot wasn't empty */ goto startover; } - wait_for_epochs(); // WHY BEFORE THE FOLLOWING? - if(BOOST_UNLIKELY(insert_counter(pos0)++!=counter)){ + auto lck=access(group_exclusive{},pos0); + if(BOOST_UNLIKELY(insert_counter(pos0)!=counter)){ /* other thread inserted from pos0, need to start over */ pg->reset(n); goto startover;