Removed research code from BronsonAVLTreeMap
authorkhizmax <libcds.dev@gmail.com>
Mon, 23 Mar 2015 06:07:48 +0000 (09:07 +0300)
committerkhizmax <libcds.dev@gmail.com>
Mon, 23 Mar 2015 06:07:48 +0000 (09:07 +0300)
cds/container/details/bronson_avltree_base.h
cds/container/impl/bronson_avltree_map_rcu.h
tests/unit/print_bronsonavltree_stat.h

index 289b17932c4cda72d72b45e72f2f2d1e243c4fe1..2b4839b69ad6f39d2e8fb1ffcbe386e1479f202e 100644 (file)
@@ -168,7 +168,6 @@ namespace cds { namespace container {
             event_counter   m_nFindSuccess; ///< Count of success \p find() call
             event_counter   m_nFindFailed;  ///< Count of failed \p find() call
             event_counter   m_nFindRetry;   ///< Count of retries during \p find()
-            event_counter   m_nFindNotFoundRetry; ///< Count of ???
             event_counter   m_nFindWaitShrinking;   ///< Count of waiting until shrinking completed duting \p find() call
 
             event_counter   m_nInsertSuccess;       ///< Count of inserting data node
@@ -198,7 +197,6 @@ namespace cds { namespace container {
             void onFindSuccess()        { ++m_nFindSuccess      ; }
             void onFindFailed()         { ++m_nFindFailed       ; }
             void onFindRetry()          { ++m_nFindRetry        ; }
-            void onFindNotFoundRetry()  { ++m_nFindNotFoundRetry; }
             void onFindWaitShrinking()  { ++m_nFindWaitShrinking; }
 
             void onInsertSuccess()          { ++m_nInsertSuccess    ; }
@@ -232,7 +230,6 @@ namespace cds { namespace container {
             void onFindSuccess()        const {}
             void onFindFailed()         const {}
             void onFindRetry()          const {}
-            void onFindNotFoundRetry()  const {}
             void onFindWaitShrinking()  const {}
 
             void onInsertSuccess()          const {}
index 905c27e50b69d9a833ba62997ec603c27ed1a40d..beecde366aea8b6def10d98fd27f6dbc9de2eb12 100644 (file)
@@ -975,14 +975,8 @@ namespace cds { namespace container {
                     }
 
                     find_result found = try_find( key, cmp, f, pChild, nCmp, nChildVersion );
-                    if ( found != find_result::retry ) {
-                        if ( found == find_result::not_found && child(pNode, nDir) != pChild ) {
-                            // Oops! That is a bug!!!
-                            m_stat.onFindNotFoundRetry();
-                        }
-                        else
-                            return found;
-                    }
+                    if ( found != find_result::retry )
+                        return found;
                 }
 
                 if ( pNode->version( memory_model::memory_order_acquire ) != nVersion ) {
@@ -1657,6 +1651,8 @@ namespace cds { namespace container {
 
         static void begin_change( node_type * pNode, version_type version )
         {
+            assert(pNode->version(memory_model::memory_order_acquire) == version );
+            assert( (version & node_type::shrinking) == 0 );
             pNode->version( version | node_type::shrinking, memory_model::memory_order_release );
         }
         static void end_change( node_type * pNode, version_type version )
index 248f3fd177b92a68b4216b7abfcf578c854b7c06..f237a28363f870d7541a928235d7ee0257212d4e 100644 (file)
@@ -18,7 +18,6 @@ namespace std {
             << "\t\t            m_nFindSuccess: " << s.m_nFindSuccess.get()         << "\n"
             << "\t\t             m_nFindFailed: " << s.m_nFindFailed.get()          << "\n"
             << "\t\t              m_nFindRetry: " << s.m_nFindRetry.get()           << "\n"
-            << "\t\t      m_nFindNotFoundRetry: " << s.m_nFindNotFoundRetry.get()   << "\n"
             << "\t\t      m_nFindWaitShrinking: " << s.m_nFindWaitShrinking.get()   << "\n"
             << "\t\t          m_nInsertSuccess: " << s.m_nInsertSuccess.get()       << "\n"
             << "\t\t    m_nRelaxedInsertFailed: " << s.m_nRelaxedInsertFailed.get() << "\n"