event_counter m_nFindSuccess; ///< Count of success \p find() call
event_counter m_nFindFailed; ///< Count of failed \p find() call
event_counter m_nFindRetry; ///< Count of retries during \p find()
- event_counter m_nFindNotFoundRetry; ///< Count of ???
event_counter m_nFindWaitShrinking; ///< Count of waiting until shrinking completed duting \p find() call
event_counter m_nInsertSuccess; ///< Count of inserting data node
void onFindSuccess() { ++m_nFindSuccess ; }
void onFindFailed() { ++m_nFindFailed ; }
void onFindRetry() { ++m_nFindRetry ; }
- void onFindNotFoundRetry() { ++m_nFindNotFoundRetry; }
void onFindWaitShrinking() { ++m_nFindWaitShrinking; }
void onInsertSuccess() { ++m_nInsertSuccess ; }
void onFindSuccess() const {}
void onFindFailed() const {}
void onFindRetry() const {}
- void onFindNotFoundRetry() const {}
void onFindWaitShrinking() const {}
void onInsertSuccess() const {}
}
find_result found = try_find( key, cmp, f, pChild, nCmp, nChildVersion );
- if ( found != find_result::retry ) {
- if ( found == find_result::not_found && child(pNode, nDir) != pChild ) {
- // Oops! That is a bug!!!
- m_stat.onFindNotFoundRetry();
- }
- else
- return found;
- }
+ if ( found != find_result::retry )
+ return found;
}
if ( pNode->version( memory_model::memory_order_acquire ) != nVersion ) {
static void begin_change( node_type * pNode, version_type version )
{
+ assert(pNode->version(memory_model::memory_order_acquire) == version );
+ assert( (version & node_type::shrinking) == 0 );
pNode->version( version | node_type::shrinking, memory_model::memory_order_release );
}
static void end_change( node_type * pNode, version_type version )
<< "\t\t m_nFindSuccess: " << s.m_nFindSuccess.get() << "\n"
<< "\t\t m_nFindFailed: " << s.m_nFindFailed.get() << "\n"
<< "\t\t m_nFindRetry: " << s.m_nFindRetry.get() << "\n"
- << "\t\t m_nFindNotFoundRetry: " << s.m_nFindNotFoundRetry.get() << "\n"
<< "\t\t m_nFindWaitShrinking: " << s.m_nFindWaitShrinking.get() << "\n"
<< "\t\t m_nInsertSuccess: " << s.m_nInsertSuccess.get() << "\n"
<< "\t\t m_nRelaxedInsertFailed: " << s.m_nRelaxedInsertFailed.get() << "\n"