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 6b80b9e..f90b696 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 5afd9a5..53e43fd 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 c2625cf..819c4e5 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 3b04a96..a19b67d 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 40b5f10..8f90aa2 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 fc3cfbc..edfaf23 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 fa1e1c6..7ed69b2 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 2e46179..832534c 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 b93ce40..4106618 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 e17a023..e27c64d 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 e9c8657..5d74b43 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 97bf884..354884f 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 76cece5..b48e938 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 bcf1183..a69bb85 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 d67853d..ffd5d17 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 );