Threadsafe Vector class for C++

前端 未结 6 667
一整个雨季
一整个雨季 2020-12-03 03:58

Does anyone know a quick and dirty threadsafe vector class for c++? I am multithreading some code, and I believe the problem I have is related to the way the vectors are us

6条回答
  •  甜味超标
    2020-12-03 04:14

    You can check out TBB (like concurrent_vector). I've never used it though, honestly, I find putting the scope guard objects around access easier (especially if the vector is properly encapsulated).

提交回复
热议问题