2012-04-08 1 views
1

나는 병렬로 실행되는 알고리즘을 가지고 있는데, 병렬화 할 것이다. 이제이 알고리즘은 C++ 11에서 unordered_map을 사용합니다. 나는 그걸 concurrent_unordered_map으로 바꿀 수 있을까?concurrent_unordered_map in C++

난 그냥 내가 이렇게 시도했지만 이해할 수없는 오류가 발생하는 것 같다 있습니다 싶습니다. 이와 같이 :

(.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)' 
+1

TBB의 도서관에 연결 했습니까? –

+0

ahaaa 덕분에 지금 작동합니다 – aTm

답변

1

concurrent_unordered_map은 동시 삽입과 동시 읽기를 허용하지만 동시 삭제는 허용하지 않습니다. 그래서 추가/반복하는 동안 당신이 삭제되지 않으면 당신은 잘되어야합니다. 코멘트에 위에서 언급 한

  • 링크 문제.
+0

tbb 라이브러리 및 Linux를 처음 사용하면서 답과 도움을 많이 주셔서 감사합니다. – aTm