I succesfully compiled the Creating vectors in shared memory example from Boost. I'm uncertain if insertions into the constructed vector from multiple processes are safe (automatically synchronized intern). The documentation talks about Synchronization guarantees but this only refers the creation/search/destruction of the shared memory.
我成功地编译了Boost*享内存示例中的Creating vectors。我不确定从多个进程插入到构造的向量中是否安全(自动同步实习)。该文档讨论了同步保证,但这仅涉及共享内存的创建/搜索/销毁。
Do you know if I have to synchronize vector accesses (insertions, deletion, iteration) manually with e.g. scoped_lock<named_mutex>
?
你知道我是否必须手动同步矢量访问(插入,删除,迭代),例如的scoped_lock
1 个解决方案
#1
4
The object you created is a std::vector
, so boost can't have added any synchronization to the standard library class. Just like any other std::vector
, you'll have to synchronize it manually.
您创建的对象是std :: vector,因此boost不能向标准库类添加任何同步。就像任何其他std :: vector一样,你必须手动同步它。
#1
4
The object you created is a std::vector
, so boost can't have added any synchronization to the standard library class. Just like any other std::vector
, you'll have to synchronize it manually.
您创建的对象是std :: vector,因此boost不能向标准库类添加任何同步。就像任何其他std :: vector一样,你必须手动同步它。