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 0e0711b3d08dd4a49e9dfd020f585dbc9f9e2551..cc676cf8725e125bb75e18515809faa52a22a4a0 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 5c5d5ec6e3ba1f8f2ac1937ad6551d1786108c68..d4593cea1d82f450c562ce8a600cf7be641caeac 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 e57839385e730839e7f808cac0bfaad0f3a78e1f..614031a13878ad2944889602948abfd7f8142fe5 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 7e324eaf5ad90168cb4464dccac69ad3f4b6bcad..3f334bfc335e4e9044d1f3d54ead5bece8a767ee 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 7d9a75af7ae8daa045290646fef7e677770a77ac..87cdba5cda922fdff7b1cfa49b783e8794c05d2f 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 1d1ab13c663f18b2b651099bd39bac90e3897f37..a9a7350d05cf12150e758f5aa37fc2522120de27 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 c341b053e98c248efb59c3758c3d4210088ddb22..0c6e2ab8f2906db0f9cbd96caf79f75bb804f9fb 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 1b2f420ef0f77fcf1fb4fdadd432d357f026e2fb..f73ccaacb36442ce2650f3183842b0c7558bcce7 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 33ac26471d43ace6767f1b3c6096e1a982b99236..4b6f682edefc73a974400edb0b44dd8bb5828c1b 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 ec0595cb3de6f0e8b982e47c1ff3962e4c7c39e1..1172071e717867664374f6c336b1aa5bbd71fdab 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 a0c41d0b3f0a768ef505ded5e27ce260617da284..c4f92a050bf71a3044933123263ada862d5529bc 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 175d665ceaf4d23e792fe1078e7a7dfe48e29987..077ceacb9b48d92de839517eee458986d434bc88 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 aa91047b601402de71d620862c6a089ac635bd18..4b14776c473d5d2bd67b1f9e8df9f0e74b4e54c2 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 1fb9269087ea4cf6b284e9ffff1b25729fcd1dbc..1fe934bc6fd9e4ed960c15321088b2dac2be5ca7 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 19f731cf43505d05d47bde9c0f21e17545e24105..174c53ac0309e1d551aeeadd52156484840c7944 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 e3de25c4f5916407ab651a90080d8f621622566b..ff6157148a4ad3ed0c4496252e1077c2a65411aa 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 26f8d44ad273ab47f67e5cc748604f9c9e7f3baa..b6f718b92a7d22a01d9f581e7439cfa9f9fbb25d 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 87cb7d85d22bb3bd5cc717af7108f265b3e35694..dd67fafbfc5093922181924edbdbc239feae8a80 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 c412346269f58c274ce85863b4c12a1c8b6e4058..dc3739195c028b895c1268ce40e331268ad9a6e0 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 f2c8e654f390e5e0247e4264c433c9539efae340..149dc701549b719f30e3eda679660f6ee511fff4 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 fad04cb37d6e12010e325245fe03baaeb4c734b4..5f162e67688a97c3b03b2bab92a54e6eac1d3b51 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 327082a2de64e980feba79da844db16622138cf4..a89d4fabf667d6e461e18b9793650abb0cafc3e4 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 1815dfbbd092b1d17200979ffce04ba0efb5caca..1ffa7277a02df2f1c72fe9bdf5334cbceaabcf63 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 7198975822fbf9666cb6854c82f9a13620698f96..83f6d0c6b06111521940024e046c78b7202ece83 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 b947c433e467629791bab8c290a9d4e0a45d3f1c..4800e2c4ea451baf5f48213040fb502ba7679453 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 2d33e02987acfac998c28696ff3e4753697f990d..8a9e1708a634a1791a0fa45aaa36a332c098c5dc 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;