Renamed "ensure" to "update" in statistics
authorkhizmax <libcds.dev@gmail.com>
Tue, 3 May 2016 05:25:40 +0000 (08:25 +0300)
committerkhizmax <libcds.dev@gmail.com>
Tue, 3 May 2016 05:25:40 +0000 (08:25 +0300)
15 files changed:
cds/container/michael_kvlist_rcu.h
cds/container/michael_set_rcu.h
cds/container/split_list_set_rcu.h
cds/intrusive/details/ellen_bintree_base.h
cds/intrusive/details/split_list_base.h
cds/intrusive/ellen_bintree_rcu.h
cds/intrusive/impl/ellen_bintree.h
cds/intrusive/split_list.h
cds/intrusive/split_list_nogc.h
cds/intrusive/split_list_rcu.h
test/include/cds_test/stat_ellenbintree_out.h
tests/unit/map2/map_delodd.h
tests/unit/print_ellenbintree_stat.h
tests/unit/print_split_list_stat.h
tests/unit/set2/set_insdel_func.cpp

index 6b80b9e1b212575e4a640600fa128c93dc041869..f90b696dac69bfc665f83ce701e592d7dc081784 100644 (file)
@@ -448,7 +448,7 @@ namespace cds { namespace container {
             return insert_with_at( head(), key, func );
         }
 
-        /// Ensures that the \p key exists in the list
+        /// Updates an element with given \p key
         /**
             The operation performs inserting or changing data with lock-free manner.
 
index 5afd9a5778a13de83cf83be20f7310cf015a6c6a..53e43fd8afc198d118aff42f636e1bae9272b24e 100644 (file)
@@ -384,36 +384,7 @@ namespace cds { namespace container {
             return bRet;
         }
 
-        /// Ensures that the item exists in the set
-        /**
-            The operation performs inserting or changing data with lock-free manner.
-
-            If the \p val key not found in the set, then the new item created from \p val
-            is inserted into the set. Otherwise, the functor \p func is called with the item found.
-            The functor \p Func signature is:
-            \code
-                struct my_functor {
-                    void operator()( bool bNew, value_type& item, const Q& val );
-                };
-            \endcode
-
-            with arguments:
-            - \p bNew - \p true if the item has been inserted, \p false otherwise
-            - \p item - item of the set
-            - \p val - argument \p key passed into the \p ensure function
 
-            The functor may change non-key fields of the \p item.
-
-            The function applies RCU lock internally.
-
-            Returns <tt> std::pair<bool, bool> </tt> where \p first is true if operation is successfull,
-            \p second is true if new item has been added or \p false if the item with \p key
-            already is in the set.
-
-            @warning For \ref cds_nonintrusive_MichaelList_rcu "MichaelList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting".
-            \ref cds_nonintrusive_LazyList_rcu "LazyList" provides exclusive access to inserted item and does not require any node-level
-            synchronization.
-        */
         /// Updates the element
         /**
             The operation performs inserting or changing data with lock-free manner.
index c2625cf96bbd6ee75346225b892098b5406f4892..819c4e5bc09b16c4efc95349cf5af272aae0aac7 100644 (file)
@@ -605,7 +605,7 @@ namespace cds { namespace container {
             return insert_node( alloc_node( std::forward<Args>(args)...));
         }
 
-        /// Ensures that the \p val exists in the set
+        /// Updates an element with given \p val
         /**
             The operation performs inserting or changing data with lock-free manner.
 
index 3b04a962f21ea1019ea7b75b9d1c5b6f5fcc35eb..a19b67d1e9db6ee48b3a30e369c9d053a36a6bba 100644 (file)
@@ -374,9 +374,9 @@ namespace cds { namespace intrusive {
             event_counter   m_nInsertSuccess        ; ///< Count of success insertion
             event_counter   m_nInsertFailed         ; ///< Count of failed insertion
             event_counter   m_nInsertRetries        ; ///< Count of unsuccessful retries of insertion
-            event_counter   m_nEnsureExist          ; ///< Count of \p ensure call for existed node
-            event_counter   m_nEnsureNew            ; ///< Count of \p ensure call for new node
-            event_counter   m_nEnsureRetries        ; ///< Count of unsuccessful retries of ensuring
+            event_counter   m_nUpdateExist          ; ///< Count of \p update() call for existed node
+            event_counter   m_nUpdateNew            ; ///< Count of \p update() call for new node
+            event_counter   m_nUpdateRetries        ; ///< Count of unsuccessful retries of ensuring
             event_counter   m_nEraseSuccess         ; ///< Count of successful call of \p erase and \p unlink
             event_counter   m_nEraseFailed          ; ///< Count of failed call of \p erase and \p unlink
             event_counter   m_nEraseRetries         ; ///< Count of unsuccessful retries inside erasing/unlinking
@@ -404,9 +404,9 @@ namespace cds { namespace intrusive {
             void    onInsertSuccess()               { ++m_nInsertSuccess        ; }
             void    onInsertFailed()                { ++m_nInsertFailed         ; }
             void    onInsertRetry()                 { ++m_nInsertRetries        ; }
-            void    onEnsureExist()                 { ++m_nEnsureExist          ; }
-            void    onEnsureNew()                   { ++m_nEnsureNew            ; }
-            void    onEnsureRetry()                 { ++m_nEnsureRetries        ; }
+            void    onUpdateExist()                 { ++m_nUpdateExist          ; }
+            void    onUpdateNew()                   { ++m_nUpdateNew            ; }
+            void    onUpdateRetry()                 { ++m_nUpdateRetries        ; }
             void    onEraseSuccess()                { ++m_nEraseSuccess         ; }
             void    onEraseFailed()                 { ++m_nEraseFailed          ; }
             void    onEraseRetry()                  { ++m_nEraseRetries         ; }
@@ -437,9 +437,9 @@ namespace cds { namespace intrusive {
             void    onInsertSuccess()               const {}
             void    onInsertFailed()                const {}
             void    onInsertRetry()                 const {}
-            void    onEnsureExist()                 const {}
-            void    onEnsureNew()                   const {}
-            void    onEnsureRetry()                 const {}
+            void    onUpdateExist()                 const {}
+            void    onUpdateNew()                   const {}
+            void    onUpdateRetry()                 const {}
             void    onEraseSuccess()                const {}
             void    onEraseFailed()                 const {}
             void    onEraseRetry()                  const {}
index 40b5f102ae33a83c7ea37792151b2260a3b7d981..8f90aa25cdad01d380f3c360df7078f90cdc057d 100644 (file)
@@ -94,8 +94,8 @@ namespace cds { namespace intrusive {
 
             counter_type    m_nInsertSuccess;        ///< Count of success inserting
             counter_type    m_nInsertFailed;         ///< Count of failed inserting
-            counter_type    m_nEnsureNew;            ///< Count of new item created by \p ensure() member function
-            counter_type    m_nEnsureExist;          ///< Count of \p ensure() call for existing item
+            counter_type    m_nUpdateNew;            ///< Count of new item created by \p ensure() member function
+            counter_type    m_nUpdateExist;          ///< Count of \p ensure() call for existing item
             counter_type    m_nEraseSuccess;         ///< Count of success erasing of items
             counter_type    m_nEraseFailed;          ///< Count of attempts to erase unknown item
             counter_type    m_nExtractSuccess;       ///< Count of success extracting of items
@@ -112,8 +112,8 @@ namespace cds { namespace intrusive {
             //@cond
             void onInsertSuccess()       { ++m_nInsertSuccess; }
             void onInsertFailed()        { ++m_nInsertFailed; }
-            void onEnsureNew()           { ++m_nEnsureNew; }
-            void onEnsureExist()         { ++m_nEnsureExist; }
+            void onUpdateNew()           { ++m_nUpdateNew; }
+            void onUpdateExist()         { ++m_nUpdateExist; }
             void onEraseSuccess()        { ++m_nEraseSuccess; }
             void onEraseFailed()         { ++m_nEraseFailed; }
             void onExtractSuccess()      { ++m_nExtractSuccess; }
@@ -142,8 +142,8 @@ namespace cds { namespace intrusive {
             //@cond
             void onInsertSuccess()       const {}
             void onInsertFailed()        const {}
-            void onEnsureNew()           const {}
-            void onEnsureExist()         const {}
+            void onUpdateNew()           const {}
+            void onUpdateExist()         const {}
             void onEraseSuccess()        const {}
             void onEraseFailed()         const {}
             void onExtractSuccess()      const {}
index fc3cfbc5564a0b89669cd744e77729d7b9d2b8f9..edfaf23594fe5d35e101fb0ffb7bf11b5e658007 100644 (file)
@@ -848,7 +848,7 @@ namespace cds { namespace intrusive {
                         func( false, *node_traits::to_value_ptr( res.pLeaf ), val );
                         if ( pNewInternal.get())
                             m_Stat.onInternalNodeDeleted() ;    // unique_internal_node_ptr deletes internal node
-                        m_Stat.onEnsureExist();
+                        m_Stat.onUpdateExist();
                         return std::make_pair( true, false );
                     }
 
@@ -869,12 +869,12 @@ namespace cds { namespace intrusive {
                         help( res.updParent, updRetire );
 
                     bkoff();
-                    m_Stat.onEnsureRetry();
+                    m_Stat.onUpdateRetry();
                 }
             }
 
             ++m_ItemCounter;
-            m_Stat.onEnsureNew();
+            m_Stat.onUpdateNew();
 
             return std::make_pair( true, true );
         }
index fa1e1c683542f1f987b6cac8518318d26f183b79..7ed69b238632aecfccc2a2a06d982aff2dfa1266 100644 (file)
@@ -437,7 +437,7 @@ namespace cds { namespace intrusive {
                     func( false, *node_traits::to_value_ptr( res.pLeaf ), val );
                     if ( pNewInternal.get() )
                         m_Stat.onInternalNodeDeleted() ;    // unique_internal_node_ptr deletes internal node
-                    m_Stat.onEnsureExist();
+                    m_Stat.onUpdateExist();
                     return std::make_pair( true, false );
                 }
 
@@ -456,11 +456,11 @@ namespace cds { namespace intrusive {
                 }
 
                 bkoff();
-                m_Stat.onEnsureRetry();
+                m_Stat.onUpdateRetry();
             }
 
             ++m_ItemCounter;
-            m_Stat.onEnsureNew();
+            m_Stat.onUpdateNew();
             return std::make_pair( true, true );
         }
         //@cond
index 2e461795ba00e7f36147f5f25545369fb22792e6..832534c7c259471348d94402d109e594747aa467 100644 (file)
@@ -754,10 +754,10 @@ namespace cds { namespace intrusive {
             std::pair<bool, bool> bRet = m_List.update_at( pHead, val, func, bAllowInsert );
             if ( bRet.first && bRet.second ) {
                 inc_item_count();
-                m_Stat.onEnsureNew();
+                m_Stat.onUpdateNew();
             }
             else
-                m_Stat.onEnsureExist();
+                m_Stat.onUpdateExist();
             return bRet;
         }
         //@cond
index b93ce4004cb34962cf5d05f770715840bd0508d9..41066182d6075c78cbaaa4cfd18aa787cfa94a8e 100644 (file)
@@ -660,10 +660,10 @@ namespace cds { namespace intrusive {
             if ( ret.first != m_List.end() ) {
                 if ( ret.second ) {
                     inc_item_count();
-                    m_Stat.onEnsureNew();
+                    m_Stat.onUpdateNew();
                 }
                 else
-                    m_Stat.onEnsureExist();
+                    m_Stat.onUpdateExist();
                 return std::make_pair( iterator(ret.first, m_List.end()), ret.second );
             }
             return std::make_pair( end(), ret.second );
index e17a0230ff3a9c1fe5e24e8cc7dd948075f11d13..e27c64d8a7dd5864ef6c59e3352f8e17a8a292e1 100644 (file)
@@ -636,10 +636,10 @@ namespace cds { namespace intrusive {
             std::pair<bool, bool> bRet = m_List.update_at( pHead, val, func, bAllowInsert );
             if ( bRet.first && bRet.second ) {
                 inc_item_count();
-                m_Stat.onEnsureNew();
+                m_Stat.onUpdateNew();
             }
             else
-                m_Stat.onEnsureExist();
+                m_Stat.onUpdateExist();
             return bRet;
         }
         //@cond
index e9c8657c3d8c2c7cc75df2466be9e02639c46c69..5d74b43029c9f9dcb221f89042b4102a91329db0 100644 (file)
@@ -53,9 +53,9 @@ namespace cds_test {
             << CDSSTRESS_STAT_OUT( s, m_nInsertSuccess )
             << CDSSTRESS_STAT_OUT( s, m_nInsertFailed )
             << CDSSTRESS_STAT_OUT( s, m_nInsertRetries )
-            << CDSSTRESS_STAT_OUT( s, m_nEnsureExist )
-            << CDSSTRESS_STAT_OUT( s, m_nEnsureNew )
-            << CDSSTRESS_STAT_OUT( s, m_nEnsureRetries )
+            << CDSSTRESS_STAT_OUT( s, m_nUpdateExist )
+            << CDSSTRESS_STAT_OUT( s, m_nUpdateNew )
+            << CDSSTRESS_STAT_OUT( s, m_nUpdateRetries )
             << CDSSTRESS_STAT_OUT( s, m_nEraseSuccess )
             << CDSSTRESS_STAT_OUT( s, m_nEraseFailed )
             << CDSSTRESS_STAT_OUT( s, m_nEraseRetries )
index 97bf8849296450ebbc7b5c902bbc80055f533a02..354884fa6b5b5cd2098b5a73083757ff48531cc0 100644 (file)
@@ -810,7 +810,7 @@ namespace map2 {
         //CDSUNIT_DECLARE_FeldmanHashMap_city
         CDSUNIT_DECLARE_CuckooMap
 
-        CPPUNIT_TEST_SUITE(Map_DelOdd)
+        CPPUNIT_TEST_SUITE_(Map_DelOdd, "map_delodd")
             CDSUNIT_TEST_MichaelMap
             CDSUNIT_TEST_SplitList
             CDSUNIT_TEST_SkipListMap
index 76cece52f46bcd3814aa8729c1600d7bada83d41..b48e938bb6700414dd7dbec3d4115c1143f30a3d 100644 (file)
@@ -52,9 +52,9 @@ namespace std {
             << "\t\t          m_nInsertSuccess: " << s.m_nInsertSuccess.get()         << "\n"
             << "\t\t           m_nInsertFailed: " << s.m_nInsertFailed.get()          << "\n"
             << "\t\t          m_nInsertRetries: " << s.m_nInsertRetries.get()         << "\n"
-            << "\t\t            m_nEnsureExist: " << s.m_nEnsureExist.get()           << "\n"
-            << "\t\t              m_nEnsureNew: " << s.m_nEnsureNew.get()             << "\n"
-            << "\t\t          m_nEnsureRetries: " << s.m_nEnsureRetries.get()         << "\n"
+            << "\t\t            m_nUpdateExist: " << s.m_nUpdateExist.get()           << "\n"
+            << "\t\t              m_nUpdateNew: " << s.m_nUpdateNew.get()             << "\n"
+            << "\t\t          m_nUpdateRetries: " << s.m_nUpdateRetries.get()         << "\n"
             << "\t\t           m_nEraseSuccess: " << s.m_nEraseSuccess.get()          << "\n"
             << "\t\t            m_nEraseFailed: " << s.m_nEraseFailed.get()           << "\n"
             << "\t\t           m_nEraseRetries: " << s.m_nEraseRetries.get()          << "\n"
index bcf11837536926235e4ccb224632a2b805806222..a69bb854bcb226d60ed3b6288c1bea66e5ee3734 100644 (file)
@@ -42,8 +42,8 @@ namespace std {
         o << "Split-list stat [cds::intrusive::split_list::stat]\n"
             << "\t\t          m_nInsertSuccess: " << s.m_nInsertSuccess.get()           << "\n"
             << "\t\t           m_nInsertFailed: " << s.m_nInsertFailed.get()            << "\n"
-            << "\t\t            m_nEnsureExist: " << s.m_nEnsureExist.get()             << "\n"
-            << "\t\t              m_nEnsureNew: " << s.m_nEnsureNew.get()               << "\n"
+            << "\t\t            m_nUpdateExist: " << s.m_nUpdateExist.get()             << "\n"
+            << "\t\t              m_nUpdateNew: " << s.m_nUpdateNew.get()               << "\n"
             << "\t\t           m_nEraseSuccess: " << s.m_nEraseSuccess.get()            << "\n"
             << "\t\t            m_nEraseFailed: " << s.m_nEraseFailed.get()             << "\n"
             << "\t\t         m_nExtractSuccess: " << s.m_nExtractSuccess.get()          << "\n"
index d67853d07faf7bd995704f28b35dafaa356ad9b4..ffd5d1713dd1c049c62e9c8d255dfed08ccaf5a4 100644 (file)
@@ -38,7 +38,7 @@ namespace set2 {
         c_nSetSize = cfg.getSizeT("MapSize", c_nSetSize );
         c_nInsertThreadCount = cfg.getSizeT("InsertThreadCount", c_nInsertThreadCount );
         c_nDeleteThreadCount = cfg.getSizeT("DeleteThreadCount", c_nDeleteThreadCount );
-        c_nUpdateThreadCount = cfg.getSizeT("EnsureThreadCount", c_nUpdateThreadCount );
+        c_nUpdateThreadCount = cfg.getSizeT("UpdateThreadCount", c_nUpdateThreadCount );
         c_nThreadPassCount = cfg.getSizeT("ThreadPassCount", c_nThreadPassCount );
         c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor );
         c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState );