我有一个串行运行的算法,我要并行化它。现在,该算法unordered_map
在 C++11 中使用。我可以用concurrent_unordered_map
直接代替它吗?
我只想指出,我已经尝试过这样做,但它似乎会产生难以理解的错误。像这个:
(.text._ZN3tbb13tbb_allocatorINS_10interface58internal18split_ordered_listISt4pairIKSsSt6vectorIjSaIjEEENS0_IS9_EEE4nodeEE8allocateEjPKv[tbb::tbb_allocator<tbb::interface5::internal::split_ordered_list<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<unsigned int, std::allocator<unsigned int> > >, tbb::tbb_allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<unsigned int, std::allocator<unsigned int> > > > >::node>::allocate(unsigned int, void const*)]+0x16): undefined reference to `tbb::internal::allocate_via_handler_v3(unsigned int)'