From 850fe0b0585c043ceef43703d081a9763688f06f Mon Sep 17 00:00:00 2001 From: khizmax Date: Sat, 18 Jun 2016 18:29:56 +0300 Subject: [PATCH] Changed combiner interruption algo --- cds/algo/flat_combining/kernel.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cds/algo/flat_combining/kernel.h b/cds/algo/flat_combining/kernel.h index 20f03240..f9843759 100644 --- a/cds/algo/flat_combining/kernel.h +++ b/cds/algo/flat_combining/kernel.h @@ -266,12 +266,12 @@ namespace cds { namespace algo { public: /// Initializes the object /** - Compact factor = 64 + Compact factor = 1024 Combiner pass count = 8 */ kernel() - : kernel( 64, 8 ) + : kernel( 1024, 8 ) {} /// Initializes the object @@ -691,11 +691,13 @@ namespace cds { namespace algo { unsigned int const nCurAge = m_nCount.fetch_add( 1, memory_model::memory_order_relaxed ) + 1; - unsigned int nEmptyPass = 0; + unsigned int nEmptyPassCount = 0; + unsigned int nUsefulPassCount = 0; for ( unsigned int nPass = 0; nPass < m_nCombinePassCount; ++nPass ) { - if ( !combining_pass( owner, nCurAge )) - if ( ++nEmptyPass > 2 ) - break; + if ( combining_pass( owner, nCurAge )) + ++nUsefulPassCount; + else if ( ++nEmptyPassCount > nUsefulPassCount ) + break; } m_Stat.onCombining(); -- 2.34.1