I am starting out with TBB, and whist having success in some areas, and seeing dramatic performance improvements, I have come a across an issue, I am struggling to understand.
I have an unordered map:-
typedef tbb::concurrent_unordered_map<CString, CGeoStation *, UTCHashCompareNoCase> CGeoStationConcurrentUnorderedMap;[/cpp]
and my variable based on this is
CGeoStationConcurrentUnorderedMap * m_pStations;
I have an issue when running the parallel_for.
Note that the work done is commented out, in essence it is an empty loop.
[cpp] tbb::parallel_for(m_pStations->range(), [&] (CGeoStationConcurrentUnorderedMap::const_range_type & range)
for(auto it = range.begin(); it != range.end(); it++)
//if(WildCmpNoCase((LPTSTR)(LPCTSTR) strSearch, (LPTSTR)(LPCTSTR) it->second->GetLabel()))
I get the assert 'my_begin_node is after my_midpoint_node' at line 822 in _concurrent_unordered_impl.h
sokey_t mid_key = solist_t::get_safe_order_key(my_midpoint_node);
__TBB_ASSERT( begin_key < mid_key, "my_begin_node is after my_midpoint_node" );
__TBB_ASSERT( mid_key <= end_key, "my_midpoint_node is after my_end_node" );
#endif // TBB_USE_ASSERT
I am not sure what the assert means, or what could be causing it, or what I need to do to fix my code.