【发布时间】:2011-11-01 17:08:58
【问题描述】:
我正在寻找使用 STL 容器(如 std::map 和 std::vector)和 pthread 的最佳策略。
什么是规范的方法?一个简单的例子:
std::map<string, vector<string>> myMap;
我们如何保证并发?
mutex_lock;
write at myMap;
mutex_unlock;
另外,我想知道 pthread 和 STL 在一起使用时是否会遇到性能问题。
系统:Liunx、g++、pthreads、无增强、无 Intel TBB
【问题讨论】:
标签: c++ linux stl concurrency pthreads