Refactoring exponential and delay back-off strategies to avoid static data members...
authorkhizmax <khizmax@gmail.com>
Wed, 31 May 2017 09:59:06 +0000 (12:59 +0300)
committerkhizmax <khizmax@gmail.com>
Wed, 31 May 2017 09:59:06 +0000 (12:59 +0300)
26 files changed:
cds/algo/backoff_strategy.h
change.log
projects/Win/vc141/gtest-map-michael.vcxproj
src/init.cpp
test/stress/stack/intrusive_stack_type.h
test/stress/stack/stack_type.h
test/unit/map/michael_iterable_dhp.cpp
test/unit/map/michael_iterable_hp.cpp
test/unit/map/michael_lazy_dhp.cpp
test/unit/map/michael_lazy_hp.cpp
test/unit/map/michael_lazy_nogc.cpp
test/unit/map/michael_michael_dhp.cpp
test/unit/map/michael_michael_hp.cpp
test/unit/map/michael_michael_nogc.cpp
test/unit/map/test_michael_lazy_rcu.h
test/unit/map/test_michael_michael_rcu.h
test/unit/set/michael_iterable_dhp.cpp
test/unit/set/michael_iterable_hp.cpp
test/unit/set/michael_lazy_dhp.cpp
test/unit/set/michael_lazy_hp.cpp
test/unit/set/michael_lazy_nogc.cpp
test/unit/set/michael_michael_dhp.cpp
test/unit/set/michael_michael_hp.cpp
test/unit/set/michael_michael_nogc.cpp
test/unit/set/test_michael_lazy_rcu.h
test/unit/set/test_michael_michael_rcu.h

index 0e0711b..cc676cf 100644 (file)
@@ -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 <cds/algo/backoff_strategy.h>
-            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<bkoff::hint, bkoff::yield, tagA> expBackOffA;
-            typedef bkoff::exponential<bkoff::hint, bkoff::yield, tagB> 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 <cds/algo/backoff_strategy.h>
             namespace bkoff = cds::backoff;
-            typedef bkoff::exponential<bkoff::hint, bkoff::yield>   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<traits_A> expBackOffA;
+            typedef bkoff::exponential<traits_B> expBackOffB;
             \endcode
         */
-        template <typename SpinBkoff, typename YieldBkoff, typename Tag=void>
+        template <typename Traits = exponential_const_traits >
         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<spin_backoff>()()) && noexcept(std::declval<yield_backoff>()()))
             {
-                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 <typename Predicate>
             bool operator()( Predicate pr ) CDS_NOEXCEPT_( noexcept(std::declval<Predicate>()()) && noexcept(std::declval<spin_backoff>()()) && noexcept(std::declval<yield_backoff>()()))
             {
-                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<spin_backoff>().reset()) && noexcept( std::declval<yield_backoff>().reset()))
             {
-                m_nExpCur = m_nExpMin;
+                m_nExpCur = traits::lower_bound;
                 m_bkSpin.reset();
                 m_bkYield.reset();
             }
@@ -317,92 +310,113 @@ namespace cds {
         };
 
         //@cond
-        template <typename SpinBkoff, typename YieldBkoff, typename Tag>
-        size_t exponential<SpinBkoff, YieldBkoff, Tag>::s_nExpMin = 16;
+        template <typename FastPathBkOff, typename SlowPathBkOff>
+        struct make_exponential
+        {
+            struct traits: public exponential_const_traits
+            {
+                typedef FastPathBkOff   fast_path_backoff;
+                typedef SlowPathBkOff   slow_path_backoff;
+            };
 
-        template <typename SpinBkoff, typename YieldBkoff, typename Tag>
-        size_t exponential<SpinBkoff, YieldBkoff, Tag>::s_nExpMax = 16 * 1024;
+            typedef exponential<traits> type;
+        };
+
+        template <typename FastPathBkOff, typename SlowPathBkOff>
+        using make_exponential_t = typename make_exponential<FastPathBkOff, SlowPathBkOff>::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 <cds/algo/backoff_strategy.h>
             namespace bkoff = cds::backoff;
 
-            struct ms5  ;   // tag to select 5ms
-            struct ms10 ;   // tag to select 10ms
-
-            // // define your back-off specialization
-            typedef bkoff::delay<std::chrono::milliseconds, ms5> delay5;
-            typedef bkoff::delay<std::chrono::milliseconds, ms10> 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 <cds/algo/backoff_strategy.h>
-            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<std::chrono::milliseconds, ms5>  delay5;
+            typedef bkoff::delay<std::chrono::milliseconds, ms10> delay10;
+
+            \endcode
         */
-        template <class Duration = std::chrono::milliseconds, typename Tag=void >
+        template <typename Traits = delay_const_traits>
         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 <typename Predicate>
             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 <class Duration, typename Tag>
-        unsigned int delay<Duration, Tag>::s_nTimeout = 5;
-        //@endcond
+        template <unsigned int Timeout, class Duration = std::chrono::milliseconds >
+        struct make_delay_of
+        {
+            struct traits {
+                typedef Duration duration_type;
+                enum: unsigned { timeout = Timeout };
+            };
 
+            typedef delay<traits> 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 <tt>cds::backoff::delay_of< 5 > bkoff</tt> is equal for
-            <tt>cds::backoff::delay<> bkoff(5)</tt>.
+            This is a simplified version of \p backoff::delay class.
+            Template parameter \p Timeout sets a delay timeout of \p Duration unit.
         */
         template <unsigned int Timeout, class Duration = std::chrono::milliseconds >
-        class delay_of: public delay<Duration>
-        {
-        //@cond
-            typedef delay<Duration> 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<hint, yield>    Default;
+        typedef exponential<exponential_const_traits>    Default;
 
         /// Default back-off strategy for lock primitives
-        typedef exponential<hint, yield>    LockDefault;
+        typedef exponential<exponential_const_traits>    LockDefault;
 
     } // namespace backoff
 } // namespace cds
index 5c5d5ec..d4593ce 100644 (file)
@@ -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
index e578393..614031a 100644 (file)
@@ -56,6 +56,7 @@
     <ClInclude Include="..\..\..\test\unit\map\test_map_hp.h" />
     <ClInclude Include="..\..\..\test\unit\map\test_map_nogc.h" />
     <ClInclude Include="..\..\..\test\unit\map\test_map_rcu.h" />
+    <ClInclude Include="..\..\..\test\unit\map\test_michael_michael_rcu.h" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{32B5098A-D846-4964-A1A7-CDE98808BFBF}</ProjectGuid>
index 7e324ea..3f334bf 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <cds/init.h>
 #include <cds/algo/atomic.h>
+#include <cds/algo/backoff_strategy.h>
 
 #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
index 7d9a75a..87cdba5 100644 (file)
@@ -151,10 +151,7 @@ namespace istack {
             cds::intrusive::treiber_stack::make_traits <
                 cds::intrusive::opt::hook< base_hook<GC> >
                 ,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<GC> >
                 , cds::opt::enable_elimination<true>
                 ,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
         {};
index 1d1ab13..a9a7350 100644 (file)
@@ -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<cds::backoff::pause, cds::backoff::yield >
                 >
             >::type
         {};
@@ -324,10 +321,7 @@ namespace stack {
             cds::container::treiber_stack::make_traits <
                 cds::opt::enable_elimination<true>
                 ,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
         {};
index c341b05..0c6e2ab 100644 (file)
@@ -119,7 +119,7 @@ namespace {
         struct list_traits: public cc::iterable_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::IterableKVList< gc_type, key_type, value_type, list_traits > list_type;
 
index 1b2f420..f73ccaa 100644 (file)
@@ -120,7 +120,7 @@ namespace {
         struct list_traits: public cc::iterable_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::IterableKVList< gc_type, key_type, value_type, list_traits > list_type;
 
index 33ac264..4b6f682 100644 (file)
@@ -119,7 +119,7 @@ namespace {
         struct list_traits: public cc::lazy_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::LazyKVList< gc_type, key_type, value_type, list_traits > list_type;
 
index ec0595c..1172071 100644 (file)
@@ -120,7 +120,7 @@ namespace {
         struct list_traits: public cc::lazy_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::LazyKVList< gc_type, key_type, value_type, list_traits > list_type;
 
index a0c41d0..c4f92a0 100644 (file)
@@ -109,7 +109,7 @@ namespace {
         struct list_traits : public cc::lazy_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::LazyKVList< gc_type, key_type, value_type, list_traits > list_type;
 
index 175d665..077ceac 100644 (file)
@@ -119,7 +119,7 @@ namespace {
         struct list_traits: public cc::michael_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::MichaelKVList< gc_type, key_type, value_type, list_traits > list_type;
 
index aa91047..4b14776 100644 (file)
@@ -120,7 +120,7 @@ namespace {
         struct list_traits: public cc::michael_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::MichaelKVList< gc_type, key_type, value_type, list_traits > list_type;
 
index 1fb9269..1fe934b 100644 (file)
@@ -109,7 +109,7 @@ namespace {
         struct list_traits : public cc::michael_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::MichaelKVList< gc_type, key_type, value_type, list_traits > list_type;
 
index 19f731c..174c53a 100644 (file)
@@ -136,7 +136,7 @@ namespace {
         struct list_traits : public cc::lazy_list::traits
         {
             typedef typename TestFixture::cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::LazyKVList< rcu_type, key_type, value_type, list_traits > list_type;
 
index e3de25c..ff61571 100644 (file)
@@ -136,7 +136,7 @@ namespace {
         struct list_traits : public cc::michael_list::traits
         {
             typedef typename TestFixture::cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::MichaelKVList< rcu_type, key_type, value_type, list_traits > list_type;
 
index 26f8d44..b6f718b 100644 (file)
@@ -137,7 +137,7 @@ namespace {
         struct list_traits : public cc::iterable_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::IterableList< gc_type, int_item, list_traits > list_type;
 
index 87cb7d8..dd67faf 100644 (file)
@@ -138,7 +138,7 @@ namespace {
         struct list_traits : public cc::iterable_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::IterableList< gc_type, int_item, list_traits > list_type;
 
index c412346..dc37391 100644 (file)
@@ -137,7 +137,7 @@ namespace {
         struct list_traits : public cc::lazy_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::LazyList< gc_type, int_item, list_traits > list_type;
 
index f2c8e65..149dc70 100644 (file)
@@ -138,7 +138,7 @@ namespace {
         struct list_traits : public cc::lazy_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::LazyList< gc_type, int_item, list_traits > list_type;
 
index fad04cb..5f162e6 100644 (file)
@@ -128,7 +128,7 @@ namespace {
         struct list_traits : public cc::lazy_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::LazyList< gc_type, int_item, list_traits > list_type;
 
index 327082a..a89d4fa 100644 (file)
@@ -137,7 +137,7 @@ namespace {
         struct list_traits : public cc::michael_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::MichaelList< gc_type, int_item, list_traits > list_type;
 
index 1815dfb..1ffa727 100644 (file)
@@ -138,7 +138,7 @@ namespace {
         struct list_traits : public cc::michael_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::MichaelList< gc_type, int_item, list_traits > list_type;
 
index 7198975..83f6d0c 100644 (file)
@@ -128,7 +128,7 @@ namespace {
         struct list_traits : public cc::michael_list::traits
         {
             typedef cmp compare;
-            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+            typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
         };
         typedef cc::MichaelList< gc_type, int_item, list_traits > list_type;
 
index b947c43..4800e2c 100644 (file)
@@ -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<cds::backoff::pause, cds::backoff::yield> back_off;
+        typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
     };
     typedef cc::LazyList< rcu_type, int_item, list_traits > list_type;
 
index 2d33e02..8a9e170 100644 (file)
@@ -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<cds::backoff::pause, cds::backoff::yield> back_off;
+        typedef cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield> back_off;
     };
     typedef cc::MichaelList< rcu_type, int_item, list_traits > list_type;