projects
/
libcds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
03aa6f4
)
SkipList: added a statistical measure
author
khizmax
<libcds.dev@gmail.com>
Sun, 25 Dec 2016 13:59:15 +0000
(16:59 +0300)
committer
khizmax
<libcds.dev@gmail.com>
Sun, 25 Dec 2016 13:59:15 +0000
(16:59 +0300)
cds/intrusive/details/skip_list_base.h
patch
|
blob
|
history
cds/intrusive/impl/skip_list.h
patch
|
blob
|
history
cds/intrusive/skip_list_rcu.h
patch
|
blob
|
history
test/include/cds_test/stat_skiplist_out.h
patch
|
blob
|
history
diff --git
a/cds/intrusive/details/skip_list_base.h
b/cds/intrusive/details/skip_list_base.h
index dbc3a272fedfa21ae47fdffca67c20c2c5aa12e7..97d30e3058646f675a19e1e31977fdc78bfbdb7c 100644
(file)
--- a/
cds/intrusive/details/skip_list_base.h
+++ b/
cds/intrusive/details/skip_list_base.h
@@
-423,6
+423,7
@@
namespace cds { namespace intrusive {
event_counter m_nEraseWhileFind ; ///< Count of erased item while searching
event_counter m_nExtractWhileFind ; ///< Count of extracted item while searching (RCU only)
event_counter m_nMarkFailed ; ///< Count of failed node marking (logical deletion mark)
event_counter m_nEraseWhileFind ; ///< Count of erased item while searching
event_counter m_nExtractWhileFind ; ///< Count of extracted item while searching (RCU only)
event_counter m_nMarkFailed ; ///< Count of failed node marking (logical deletion mark)
+ event_counter m_nEraseContention ; ///< Count of key erasing contention encountered
//@cond
void onAddNode( unsigned int nHeight )
//@cond
void onAddNode( unsigned int nHeight )
@@
-472,6
+473,7
@@
namespace cds { namespace intrusive {
void onExtractMaxFailed() { ++m_nExtractMaxFailed; }
void onExtractMaxRetry() { ++m_nExtractMaxRetries; }
void onMarkFailed() { ++m_nMarkFailed; }
void onExtractMaxFailed() { ++m_nExtractMaxFailed; }
void onExtractMaxRetry() { ++m_nExtractMaxRetries; }
void onMarkFailed() { ++m_nMarkFailed; }
+ void onEraseContention() { ++m_nEraseContention; }
//@endcond
};
//@endcond
};
@@
-516,6
+518,7
@@
namespace cds { namespace intrusive {
void onExtractMaxFailed() const {}
void onExtractMaxRetry() const {}
void onMarkFailed() const {}
void onExtractMaxFailed() const {}
void onExtractMaxRetry() const {}
void onMarkFailed() const {}
+ void onEraseContention() const {}
//@endcond
};
//@endcond
};
diff --git
a/cds/intrusive/impl/skip_list.h
b/cds/intrusive/impl/skip_list.h
index db291380ded5bc49bb888aba59dd936aeb590e3d..c3b38f0e47682eba17dc1825f27784d0dbb925c4 100644
(file)
--- a/
cds/intrusive/impl/skip_list.h
+++ b/
cds/intrusive/impl/skip_list.h
@@
-1453,8
+1453,9
@@
namespace cds { namespace intrusive {
m_Stat.onFastErase();
return true;
}
m_Stat.onFastErase();
return true;
}
- else if ( p.bits()
) {
+ else if ( p.bits()) {
// Another thread is deleting pDel right now
// Another thread is deleting pDel right now
+ m_Stat.onEraseContention();
return false;
}
m_Stat.onEraseRetry();
return false;
}
m_Stat.onEraseRetry();
diff --git
a/cds/intrusive/skip_list_rcu.h
b/cds/intrusive/skip_list_rcu.h
index 52dccdd76b6a95adbdf667020090d26750845e3e..24a12ceeff5171108a7489eeab1695ba23618b3a 100644
(file)
--- a/
cds/intrusive/skip_list_rcu.h
+++ b/
cds/intrusive/skip_list_rcu.h
@@
-1720,6
+1720,7
@@
namespace cds { namespace intrusive {
}
else if ( p.bits() ) {
// Another thread is deleting pDel right now
}
else if ( p.bits() ) {
// Another thread is deleting pDel right now
+ m_Stat.onEraseContention();
return false;
}
return false;
}
diff --git
a/test/include/cds_test/stat_skiplist_out.h
b/test/include/cds_test/stat_skiplist_out.h
index 69f3894c1dc62dc515a03a9248b2858d7a1018f4..d263130a10fe45e908a6fff92a8970a1fed2b101 100644
(file)
--- a/
test/include/cds_test/stat_skiplist_out.h
+++ b/
test/include/cds_test/stat_skiplist_out.h
@@
-85,7
+85,8
@@
namespace cds_test {
<< CDSSTRESS_STAT_OUT( s, m_nSlowExtract )
<< CDSSTRESS_STAT_OUT( s, m_nEraseWhileFind )
<< CDSSTRESS_STAT_OUT( s, m_nExtractWhileFind )
<< CDSSTRESS_STAT_OUT( s, m_nSlowExtract )
<< CDSSTRESS_STAT_OUT( s, m_nEraseWhileFind )
<< CDSSTRESS_STAT_OUT( s, m_nExtractWhileFind )
- << CDSSTRESS_STAT_OUT( s, m_nMarkFailed );
+ << CDSSTRESS_STAT_OUT( s, m_nMarkFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nEraseContention );
}
} // namespace cds_test
}
} // namespace cds_test