From e33b0fa4d5c909fa6297722f81cede857fac4bbe Mon Sep 17 00:00:00 2001 From: khizmax Date: Wed, 31 May 2017 12:59:06 +0300 Subject: [PATCH 1/1] Refactoring exponential and delay back-off strategies to avoid static data members in template classes --- cds/algo/backoff_strategy.h | 276 ++++++++++--------- change.log | 2 + projects/Win/vc141/gtest-map-michael.vcxproj | 1 + src/init.cpp | 8 + test/stress/stack/intrusive_stack_type.h | 10 +- test/stress/stack/stack_type.h | 10 +- test/unit/map/michael_iterable_dhp.cpp | 2 +- test/unit/map/michael_iterable_hp.cpp | 2 +- test/unit/map/michael_lazy_dhp.cpp | 2 +- test/unit/map/michael_lazy_hp.cpp | 2 +- test/unit/map/michael_lazy_nogc.cpp | 2 +- test/unit/map/michael_michael_dhp.cpp | 2 +- test/unit/map/michael_michael_hp.cpp | 2 +- test/unit/map/michael_michael_nogc.cpp | 2 +- test/unit/map/test_michael_lazy_rcu.h | 2 +- test/unit/map/test_michael_michael_rcu.h | 2 +- test/unit/set/michael_iterable_dhp.cpp | 2 +- test/unit/set/michael_iterable_hp.cpp | 2 +- test/unit/set/michael_lazy_dhp.cpp | 2 +- test/unit/set/michael_lazy_hp.cpp | 2 +- test/unit/set/michael_lazy_nogc.cpp | 2 +- test/unit/set/michael_michael_dhp.cpp | 2 +- test/unit/set/michael_michael_hp.cpp | 2 +- test/unit/set/michael_michael_nogc.cpp | 2 +- test/unit/set/test_michael_lazy_rcu.h | 2 +- test/unit/set/test_michael_michael_rcu.h | 2 +- 26 files changed, 178 insertions(+), 169 deletions(-) diff --git a/cds/algo/backoff_strategy.h b/cds/algo/backoff_strategy.h index 0e0711b3..cc676cf8 100644 --- a/cds/algo/backoff_strategy.h +++ b/cds/algo/backoff_strategy.h @@ -179,6 +179,28 @@ namespace cds { //@endcond }; + /// \p backoff::exponential const traits + struct exponential_const_traits + { + typedef hint fast_path_backoff; ///< Fast-path back-off strategy + typedef yield slow_path_backoff; ///< Slow-path back-off strategy + + enum: size_t { + lower_bound = 16, ///< Minimum spinning limit + upper_bound = 16 * 1024 ///< Maximum spinning limit + }; + }; + + /// \p nackoff::exponential runtime traits + struct exponential_runtime_traits + { + typedef hint fast_path_backoff; ///< Fast-path back-off strategy + typedef yield slow_path_backoff; ///< Slow-path back-off strategy + + static size_t lower_bound; ///< Minimum spinning limit, default is 16 + static size_t upper_bound; ///< Maximum spinning limit, default is 16*1024 + }; + /// Exponential back-off /** This back-off strategy is composite. It consists of \p SpinBkoff and \p YieldBkoff @@ -188,102 +210,73 @@ namespace cds { where it applies \p YieldBkoff until \p reset() is called. On each spinning iteration the internal spinning counter is doubled. - Choosing the best value for maximum spinning bound is platform and task specific. - In this implementation, the default values for maximum and minimum spinning is statically - declared so you can set its value globally for your platform. - The third template argument, \p Tag, is used to separate implementation. For - example, you may define two \p exponential back-offs that is the best for your task A and B: - \code + Selecting the best value for maximum spinning limit is platform and application specific task. + The limits are described by \p Traits template parameter. + There are two types of \p Traits: + - constant traits \p exponential_const_traits - specifies the lower and upper limits + as a compile-time constants; to change the limits you should recompile your application + - runtime traits \p exponential_runtime_traits - specifies the limits as \p s_nExpMin + and \p s_nExpMax variables which can be changed at runtime to tune back-off strategy. - #include - namespace bkoff = cds::backoff; + The traits class must declare two data member: + - \p lower_bound - the lower bound of spinning loop + - \p upper_bound - the upper boudn of spinning loop - struct tagA ; // tag to select task A implementation - struct tagB ; // tag to select task B implementation - - // // define your back-off specialization - typedef bkoff::exponential expBackOffA; - typedef bkoff::exponential expBackOffB; - - // // set up the best bounds for task A - expBackOffA::s_nExpMin = 32; - expBackOffA::s_nExpMax = 1024; - - // // set up the best bounds for task B - expBackOffB::s_nExpMin = 2; - expBackOffB::s_nExpMax = 512; - - \endcode - - Another way of solving this problem is subclassing \p exponential back-off class: + You may use \p Traits template parameter to separate back-off implementations. + For example, you may define two \p exponential back-offs that is the best for your task A and B: \code + #include namespace bkoff = cds::backoff; - typedef bkoff::exponential base_bkoff; - class expBackOffA: public base_bkoff + // the best bounds for task A + struct traits_A: public bkoff::exponential_const_traits { - public: - expBackOffA() - : base_bkoff( 32, 1024 ) - {} + static size_t lower_bound; + static size_t upper_bound; }; + size_t traits_A::lower_bound = 1024; + size_t traits_A::upper_bound = 8 * 1024; - class expBackOffB: public base_bkoff + // the best bounds for task B + struct traits_B: public bkoff::exponential_const_traits { - public: - expBackOffB() - : base_bkoff( 2, 512 ) - {} + static size_t lower_bound; + static size_t upper_bound; }; + size_t traits_A::lower_bound = 16; + size_t traits_A::upper_bound = 1024; + + // // define your back-off specialization + typedef bkoff::exponential expBackOffA; + typedef bkoff::exponential expBackOffB; \endcode */ - template + template class exponential { public: - typedef SpinBkoff spin_backoff ; ///< spin back-off strategy - typedef YieldBkoff yield_backoff ; ///< yield back-off strategy - typedef Tag impl_tag ; ///< implementation separation tag + typedef Traits traits; ///< Traits - static size_t s_nExpMin ; ///< Default minimum spinning bound (16) - static size_t s_nExpMax ; ///< Default maximum spinning bound (16384) + typedef typename traits::fast_path_backoff spin_backoff ; ///< spin (fast-path) back-off strategy + typedef typename traits::slow_path_backoff yield_backoff ; ///< yield (slow-path) back-off strategy protected: - size_t m_nExpCur ; ///< Current spinning - size_t m_nExpMin ; ///< Minimum spinning bound - size_t m_nExpMax ; ///< Maximum spinning bound + size_t m_nExpCur ; ///< Current spin counter in range [traits::s_nExpMin, traits::s_nExpMax] spin_backoff m_bkSpin ; ///< Spinning (fast-path) phase back-off strategy yield_backoff m_bkYield ; ///< Yield phase back-off strategy public: - /// Initializes m_nExpMin and m_nExpMax from default s_nExpMin and s_nExpMax respectively + /// Default ctor exponential() CDS_NOEXCEPT - : m_nExpMin( s_nExpMin ) - , m_nExpMax( s_nExpMax ) - { - m_nExpCur = m_nExpMin; - } - - /// Explicitly defined bounds of spinning - /** - The \p libcds library never calls this ctor. - */ - exponential( - size_t nExpMin, ///< Minimum spinning - size_t nExpMax ///< Maximum spinning - ) CDS_NOEXCEPT - : m_nExpMin( nExpMin ) - , m_nExpMax( nExpMax ) - { - m_nExpCur = m_nExpMin; - } + : m_nExpCur( traits::lower_bound ) + {} //@cond void operator ()() CDS_NOEXCEPT_(noexcept(std::declval()()) && noexcept(std::declval()())) { - if ( m_nExpCur <= m_nExpMax ) { + if ( m_nExpCur <= traits::upper_bound ) { for ( size_t n = 0; n < m_nExpCur; ++n ) m_bkSpin(); m_nExpCur *= 2; @@ -295,7 +288,7 @@ namespace cds { template bool operator()( Predicate pr ) CDS_NOEXCEPT_( noexcept(std::declval()()) && noexcept(std::declval()()) && noexcept(std::declval()())) { - if ( m_nExpCur <= m_nExpMax ) { + if ( m_nExpCur <= traits::upper_bound ) { for ( size_t n = 0; n < m_nExpCur; ++n ) { if ( m_bkSpin(pr)) return true; @@ -309,7 +302,7 @@ namespace cds { void reset() CDS_NOEXCEPT_( noexcept( std::declval().reset()) && noexcept( std::declval().reset())) { - m_nExpCur = m_nExpMin; + m_nExpCur = traits::lower_bound; m_bkSpin.reset(); m_bkYield.reset(); } @@ -317,92 +310,113 @@ namespace cds { }; //@cond - template - size_t exponential::s_nExpMin = 16; + template + struct make_exponential + { + struct traits: public exponential_const_traits + { + typedef FastPathBkOff fast_path_backoff; + typedef SlowPathBkOff slow_path_backoff; + }; - template - size_t exponential::s_nExpMax = 16 * 1024; + typedef exponential type; + }; + + template + using make_exponential_t = typename make_exponential::type; //@endcond + /// Constant traits for \ref delay back-off strategy + struct delay_const_traits + { + typedef std::chrono::milliseconds duration_type; ///< Timeout type + enum: unsigned { + timeout = 5 ///< Delay timeout + }; + }; + + /// Runtime traits for \ref delay back-off strategy + struct delay_runtime_traits + { + typedef std::chrono::milliseconds duration_type; ///< Timeout type + static unsigned timeout; ///< Delay timeout, default 5 + }; + /// Delay back-off strategy /** Template arguments: - \p Duration - duration type, default is \p std::chrono::milliseconds - - \p Tag - a selector tag - - Choosing the best value for th timeout is platform and task specific. - In this implementation, the default values for timeout is statically - declared so you can set its value globally for your platform. - The second template argument, \p Tag, is used to separate implementation. For - example, you may define two \p delay back-offs for 5 and 10 ms timeout: + - \p Traits - a class that defines default timeout. + + Choosing the best value for th timeout is platform and application specific task. + The default values for timeout is provided by \p Traits class that should + \p timeout data member. There are two predefined \p Traits implementation: + - \p delay_const_traits - defines \p timeout as a constant (enum). + To change timeout you should recompile your application. + - \p delay_runtime_traits - specifies timeout as static data member that can be changed + at runtime to tune the back-off strategy. + + You may use \p Traits template parameter to separate back-off implementations. + For example, you may define two \p delay back-offs for 5 and 10 ms timeout: \code #include namespace bkoff = cds::backoff; - struct ms5 ; // tag to select 5ms - struct ms10 ; // tag to select 10ms - - // // define your back-off specialization - typedef bkoff::delay delay5; - typedef bkoff::delay delay10; - - // // set up the timeouts - delay5::s_nTimeout = 5; - delay10::s_nTimeout = 10; - \endcode - - Another way of solving this problem is subclassing \p delay back-off class: - \code - #include - namespace bkoff = cds::backoff; - typedef bkoff::delay<> delay_bkoff; - - class delay5: public delay_bkoff { - public: - delay5(): delay_bkoff( 5 ) {} + // 5ms delay + struct ms5 + { + typedef std::chrono::milliseconds duration_type; + enum: unsigned { timeout = 5 }; }; - class delay10: public delay_bkoff { - public: - delay10(): delay_bkoff( 10 ) {} + // 10ms delay, runtime support + struct ms10 + { + typedef std::chrono::milliseconds duration_type; + static unsigned timeout; }; - \endcode + unsigned ms10::timeout = 10; + // define your back-off specialization + typedef bkoff::delay delay5; + typedef bkoff::delay delay10; + + \endcode */ - template + template class delay { public: - typedef Duration duration_type; ///< Duration type (default \p std::chrono::milliseconds) - static unsigned int s_nTimeout; ///< default timeout, =5 + typedef Traits traits; ///< Traits + typedef typename Traits::duration_type duration_type; ///< Duration type (default \p std::chrono::milliseconds) protected: ///@cond - unsigned int const m_nTimeout; + duration_type const timeout; ///@endcond public: - /// Default ctor takes the timeout from s_nTimeout + /// Default ctor takes the timeout from \p traits::timeout delay() CDS_NOEXCEPT - : m_nTimeout( s_nTimeout ) + : timeout( traits::timeout ) {} /// Initializes timeout from \p nTimeout CDS_CONSTEXPR explicit delay( unsigned int nTimeout ) CDS_NOEXCEPT - : m_nTimeout( nTimeout ) + : timeout( nTimeout ) {} //@cond void operator()() const { - std::this_thread::sleep_for( duration_type( m_nTimeout )); + std::this_thread::sleep_for( timeout ); } template bool operator()(Predicate pr) const { - for ( unsigned int i = 0; i < m_nTimeout; i += 2 ) { + for ( unsigned int i = 0; i < traits::timeout; i += 2 ) { if ( pr()) return true; std::this_thread::sleep_for( duration_type( 2 )); @@ -416,36 +430,32 @@ namespace cds { }; //@cond - template - unsigned int delay::s_nTimeout = 5; - //@endcond + template + struct make_delay_of + { + struct traits { + typedef Duration duration_type; + enum: unsigned { timeout = Timeout }; + }; + typedef delay type; + }; + //@endcond /// Delay back-off strategy, template version /** - This is a template version of backoff::delay class. - Template parameter \p Timeout sets a delay timeout. - The declaration cds::backoff::delay_of< 5 > bkoff is equal for - cds::backoff::delay<> bkoff(5). + This is a simplified version of \p backoff::delay class. + Template parameter \p Timeout sets a delay timeout of \p Duration unit. */ template - class delay_of: public delay - { - //@cond - typedef delay base_class; - public: - delay_of() CDS_NOEXCEPT - : base_class( Timeout ) - {} - //@endcond - }; + using delay_of = typename make_delay_of< Timeout, Duration >::type; /// Default backoff strategy - typedef exponential Default; + typedef exponential Default; /// Default back-off strategy for lock primitives - typedef exponential LockDefault; + typedef exponential LockDefault; } // namespace backoff } // namespace cds diff --git a/change.log b/change.log index 5c5d5ec6..d4593cea 100644 --- a/change.log +++ b/change.log @@ -31,6 +31,8 @@ envvar CDSTEST_DETAIL_LEVEL for reducing compile time and executable size. To make full testset compile libcds with -DCDS_STRESS_TEST_LEVEL=N where N is 1 or 2. + - Changed: refactoring cds::backoff::exponential and cds::backoff::delay + back-off strategies to avoid static data members in template classes. 2.2.0 04.01.2017 General release diff --git a/projects/Win/vc141/gtest-map-michael.vcxproj b/projects/Win/vc141/gtest-map-michael.vcxproj index e5783938..614031a1 100644 --- a/projects/Win/vc141/gtest-map-michael.vcxproj +++ b/projects/Win/vc141/gtest-map-michael.vcxproj @@ -56,6 +56,7 @@ + {32B5098A-D846-4964-A1A7-CDE98808BFBF} diff --git a/src/init.cpp b/src/init.cpp index 7e324eaf..3f334bfc 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -30,6 +30,7 @@ #include #include +#include #if CDS_OS_INTERFACE == CDS_OSI_WINDOWS && CDS_OS_TYPE != CDS_OS_MINGW # if CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL @@ -87,4 +88,11 @@ namespace cds { } } // namespace details + namespace backoff { + /*static*/ size_t exponential_runtime_traits::lower_bound = 16; + /*static*/ size_t exponential_runtime_traits::upper_bound = 16 * 1024; + + /*static*/ unsigned delay_runtime_traits::timeout = 5; + } // namespace backoff + } // namespace cds diff --git a/test/stress/stack/intrusive_stack_type.h b/test/stress/stack/intrusive_stack_type.h index 7d9a75af..87cdba5c 100644 --- a/test/stress/stack/intrusive_stack_type.h +++ b/test/stress/stack/intrusive_stack_type.h @@ -151,10 +151,7 @@ namespace istack { cds::intrusive::treiber_stack::make_traits < cds::intrusive::opt::hook< base_hook > ,cds::opt::back_off< - cds::backoff::exponential< - cds::backoff::pause, - cds::backoff::yield - > + cds::backoff::make_exponential_t< cds::backoff::pause,cds::backoff::yield > > > ::type {}; @@ -302,10 +299,7 @@ namespace istack { cds::intrusive::opt::hook< base_hook > , cds::opt::enable_elimination ,cds::opt::back_off< - cds::backoff::exponential< - cds::backoff::pause, - cds::backoff::yield - > + cds::backoff::make_exponential_t< cds::backoff::pause, cds::backoff::yield > > > ::type {}; diff --git a/test/stress/stack/stack_type.h b/test/stress/stack/stack_type.h index 1d1ab13c..a9a7350d 100644 --- a/test/stress/stack/stack_type.h +++ b/test/stress/stack/stack_type.h @@ -187,10 +187,7 @@ namespace stack { struct traits_Treiber_exp: public cds::container::treiber_stack::make_traits< cds::opt::back_off< - cds::backoff::exponential< - cds::backoff::pause, - cds::backoff::yield - > + cds::backoff::make_exponential_t > >::type {}; @@ -324,10 +321,7 @@ namespace stack { cds::container::treiber_stack::make_traits < cds::opt::enable_elimination ,cds::opt::back_off< - cds::backoff::exponential< - cds::backoff::pause, - cds::backoff::yield - > + cds::backoff::make_exponential_t< cds::backoff::pause, cds::backoff::yield > > > ::type {}; diff --git a/test/unit/map/michael_iterable_dhp.cpp b/test/unit/map/michael_iterable_dhp.cpp index c341b053..0c6e2ab8 100644 --- a/test/unit/map/michael_iterable_dhp.cpp +++ b/test/unit/map/michael_iterable_dhp.cpp @@ -119,7 +119,7 @@ namespace { struct list_traits: public cc::iterable_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::IterableKVList< gc_type, key_type, value_type, list_traits > list_type; diff --git a/test/unit/map/michael_iterable_hp.cpp b/test/unit/map/michael_iterable_hp.cpp index 1b2f420e..f73ccaac 100644 --- a/test/unit/map/michael_iterable_hp.cpp +++ b/test/unit/map/michael_iterable_hp.cpp @@ -120,7 +120,7 @@ namespace { struct list_traits: public cc::iterable_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::IterableKVList< gc_type, key_type, value_type, list_traits > list_type; diff --git a/test/unit/map/michael_lazy_dhp.cpp b/test/unit/map/michael_lazy_dhp.cpp index 33ac2647..4b6f682e 100644 --- a/test/unit/map/michael_lazy_dhp.cpp +++ b/test/unit/map/michael_lazy_dhp.cpp @@ -119,7 +119,7 @@ namespace { struct list_traits: public cc::lazy_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::LazyKVList< gc_type, key_type, value_type, list_traits > list_type; diff --git a/test/unit/map/michael_lazy_hp.cpp b/test/unit/map/michael_lazy_hp.cpp index ec0595cb..1172071e 100644 --- a/test/unit/map/michael_lazy_hp.cpp +++ b/test/unit/map/michael_lazy_hp.cpp @@ -120,7 +120,7 @@ namespace { struct list_traits: public cc::lazy_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::LazyKVList< gc_type, key_type, value_type, list_traits > list_type; diff --git a/test/unit/map/michael_lazy_nogc.cpp b/test/unit/map/michael_lazy_nogc.cpp index a0c41d0b..c4f92a05 100644 --- a/test/unit/map/michael_lazy_nogc.cpp +++ b/test/unit/map/michael_lazy_nogc.cpp @@ -109,7 +109,7 @@ namespace { struct list_traits : public cc::lazy_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::LazyKVList< gc_type, key_type, value_type, list_traits > list_type; diff --git a/test/unit/map/michael_michael_dhp.cpp b/test/unit/map/michael_michael_dhp.cpp index 175d665c..077ceacb 100644 --- a/test/unit/map/michael_michael_dhp.cpp +++ b/test/unit/map/michael_michael_dhp.cpp @@ -119,7 +119,7 @@ namespace { struct list_traits: public cc::michael_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::MichaelKVList< gc_type, key_type, value_type, list_traits > list_type; diff --git a/test/unit/map/michael_michael_hp.cpp b/test/unit/map/michael_michael_hp.cpp index aa91047b..4b14776c 100644 --- a/test/unit/map/michael_michael_hp.cpp +++ b/test/unit/map/michael_michael_hp.cpp @@ -120,7 +120,7 @@ namespace { struct list_traits: public cc::michael_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::MichaelKVList< gc_type, key_type, value_type, list_traits > list_type; diff --git a/test/unit/map/michael_michael_nogc.cpp b/test/unit/map/michael_michael_nogc.cpp index 1fb92690..1fe934bc 100644 --- a/test/unit/map/michael_michael_nogc.cpp +++ b/test/unit/map/michael_michael_nogc.cpp @@ -109,7 +109,7 @@ namespace { struct list_traits : public cc::michael_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::MichaelKVList< gc_type, key_type, value_type, list_traits > list_type; diff --git a/test/unit/map/test_michael_lazy_rcu.h b/test/unit/map/test_michael_lazy_rcu.h index 19f731cf..174c53ac 100644 --- a/test/unit/map/test_michael_lazy_rcu.h +++ b/test/unit/map/test_michael_lazy_rcu.h @@ -136,7 +136,7 @@ namespace { struct list_traits : public cc::lazy_list::traits { typedef typename TestFixture::cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::LazyKVList< rcu_type, key_type, value_type, list_traits > list_type; diff --git a/test/unit/map/test_michael_michael_rcu.h b/test/unit/map/test_michael_michael_rcu.h index e3de25c4..ff615714 100644 --- a/test/unit/map/test_michael_michael_rcu.h +++ b/test/unit/map/test_michael_michael_rcu.h @@ -136,7 +136,7 @@ namespace { struct list_traits : public cc::michael_list::traits { typedef typename TestFixture::cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::MichaelKVList< rcu_type, key_type, value_type, list_traits > list_type; diff --git a/test/unit/set/michael_iterable_dhp.cpp b/test/unit/set/michael_iterable_dhp.cpp index 26f8d44a..b6f718b9 100644 --- a/test/unit/set/michael_iterable_dhp.cpp +++ b/test/unit/set/michael_iterable_dhp.cpp @@ -137,7 +137,7 @@ namespace { struct list_traits : public cc::iterable_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::IterableList< gc_type, int_item, list_traits > list_type; diff --git a/test/unit/set/michael_iterable_hp.cpp b/test/unit/set/michael_iterable_hp.cpp index 87cb7d85..dd67fafb 100644 --- a/test/unit/set/michael_iterable_hp.cpp +++ b/test/unit/set/michael_iterable_hp.cpp @@ -138,7 +138,7 @@ namespace { struct list_traits : public cc::iterable_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::IterableList< gc_type, int_item, list_traits > list_type; diff --git a/test/unit/set/michael_lazy_dhp.cpp b/test/unit/set/michael_lazy_dhp.cpp index c4123462..dc373919 100644 --- a/test/unit/set/michael_lazy_dhp.cpp +++ b/test/unit/set/michael_lazy_dhp.cpp @@ -137,7 +137,7 @@ namespace { struct list_traits : public cc::lazy_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::LazyList< gc_type, int_item, list_traits > list_type; diff --git a/test/unit/set/michael_lazy_hp.cpp b/test/unit/set/michael_lazy_hp.cpp index f2c8e654..149dc701 100644 --- a/test/unit/set/michael_lazy_hp.cpp +++ b/test/unit/set/michael_lazy_hp.cpp @@ -138,7 +138,7 @@ namespace { struct list_traits : public cc::lazy_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::LazyList< gc_type, int_item, list_traits > list_type; diff --git a/test/unit/set/michael_lazy_nogc.cpp b/test/unit/set/michael_lazy_nogc.cpp index fad04cb3..5f162e67 100644 --- a/test/unit/set/michael_lazy_nogc.cpp +++ b/test/unit/set/michael_lazy_nogc.cpp @@ -128,7 +128,7 @@ namespace { struct list_traits : public cc::lazy_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::LazyList< gc_type, int_item, list_traits > list_type; diff --git a/test/unit/set/michael_michael_dhp.cpp b/test/unit/set/michael_michael_dhp.cpp index 327082a2..a89d4fab 100644 --- a/test/unit/set/michael_michael_dhp.cpp +++ b/test/unit/set/michael_michael_dhp.cpp @@ -137,7 +137,7 @@ namespace { struct list_traits : public cc::michael_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::MichaelList< gc_type, int_item, list_traits > list_type; diff --git a/test/unit/set/michael_michael_hp.cpp b/test/unit/set/michael_michael_hp.cpp index 1815dfbb..1ffa7277 100644 --- a/test/unit/set/michael_michael_hp.cpp +++ b/test/unit/set/michael_michael_hp.cpp @@ -138,7 +138,7 @@ namespace { struct list_traits : public cc::michael_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::MichaelList< gc_type, int_item, list_traits > list_type; diff --git a/test/unit/set/michael_michael_nogc.cpp b/test/unit/set/michael_michael_nogc.cpp index 71989758..83f6d0c6 100644 --- a/test/unit/set/michael_michael_nogc.cpp +++ b/test/unit/set/michael_michael_nogc.cpp @@ -128,7 +128,7 @@ namespace { struct list_traits : public cc::michael_list::traits { typedef cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::MichaelList< gc_type, int_item, list_traits > list_type; diff --git a/test/unit/set/test_michael_lazy_rcu.h b/test/unit/set/test_michael_lazy_rcu.h index b947c433..4800e2c4 100644 --- a/test/unit/set/test_michael_lazy_rcu.h +++ b/test/unit/set/test_michael_lazy_rcu.h @@ -153,7 +153,7 @@ TYPED_TEST_P( MichaelLazySet, backoff ) struct list_traits : public cc::lazy_list::traits { typedef typename TestFixture::cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::LazyList< rcu_type, int_item, list_traits > list_type; diff --git a/test/unit/set/test_michael_michael_rcu.h b/test/unit/set/test_michael_michael_rcu.h index 2d33e029..8a9e1708 100644 --- a/test/unit/set/test_michael_michael_rcu.h +++ b/test/unit/set/test_michael_michael_rcu.h @@ -153,7 +153,7 @@ TYPED_TEST_P( MichaelSet, backoff ) struct list_traits : public cc::michael_list::traits { typedef typename TestFixture::cmp compare; - typedef cds::backoff::exponential back_off; + typedef cds::backoff::make_exponential_t back_off; }; typedef cc::MichaelList< rcu_type, int_item, list_traits > list_type; -- 2.34.1