projects
/
libcds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
08c256d
)
Changed combiner interruption algo
author
khizmax
<libcds.dev@gmail.com>
Sat, 18 Jun 2016 15:29:56 +0000
(18:29 +0300)
committer
khizmax
<libcds.dev@gmail.com>
Sat, 18 Jun 2016 15:29:56 +0000
(18:29 +0300)
cds/algo/flat_combining/kernel.h
patch
|
blob
|
history
diff --git
a/cds/algo/flat_combining/kernel.h
b/cds/algo/flat_combining/kernel.h
index 20f032404dd03d190bdd88734dbcbac776aa6e83..f98437592b32dd6c5253e816c015cf29c4e0b2c3 100644
(file)
--- 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
/**
public:
/// Initializes the object
/**
- Compact factor =
6
4
+ Compact factor =
102
4
Combiner pass count = 8
*/
kernel()
Combiner pass count = 8
*/
kernel()
- : kernel(
6
4, 8 )
+ : kernel(
102
4, 8 )
{}
/// Initializes the object
{}
/// 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 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 ) {
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();
}
m_Stat.onCombining();