boost进程间容器中的boost进程间错误
boost interprocess error in boost interprocess containers
我有一个boost进程间向量,它包含字符串(boost::interprocess::basic_string)作为保存在共享内存中的值,我在长期运行的中收到了这个错误
include/boost/interprocess/mem_algo/rbtree_best_fit.hpp:1346: void boost::interprocess::rbtree_best_fit<MutexFamily, VoidMutex, MemAlignment>::priv_deallocate(void*) [with MutexFamily = boost::interprocess::mutex_family; VoidPointer = boost::interprocess::offset_ptr<void>; long unsigned int MemAlignment = 0ul]: Assertion
privat_is_allocated_block(块)'失败。`
总共有6个进程写入该矢量,一个进程弹出数据。
问题:
- 访问共享内存的进程数量是否有任何限制,尤其是提升托管容器
- 我所理解的是,段管理器和mem算法保存在共享内存中,正确吗
我使用这个类:
class SharedVector {
public:
boost::interprocess::interprocess_mutex mutex;
complex_vect_type m_vect;
SharedVector(const void_allocator &a) : m_vect(a) {}
};
为了创造,我这样做:
memsegment->construct<SharedVector>("sharedvector") (*m_allocator);
在另一个过程中,我这样做是为了访问它
mem_segment->find<SharedVector>(t"sharedvector").first;
-
没有没有限制
-
是
你没有提到任何锁。我想这可以解释你的问题。
多个进程同时访问共享资源需要与多个线程相同的访问同步量。当然,不同之处在于,您使用进程间同步对象
相关文章:
- boost::进程间消息队列引发错误
- 避免使用 boost::进程间::消息队列创建文件
- Boost进程"系统"功能中的错误处理
- 如何重现 Boost 进程文档提示的死锁?
- Boost.进程间内存位置
- 包含字符串的结构的 Boost 进程间向量是否需要特殊的分配器?
- std::unordered_map 在共享内存中使用 boost:::进程间分配器 - 缺点?
- 当一个进程截断 Boost 进程间库创建的共享内存时,进程需要重新映射
- 使用boost进程间库的phpexec共享内存和Cloudfoundry容器问题
- boost::进程间 - allocate_aligned - 保证所有进程的一致性相同
- boost::进程间消息队列创建时的竞争条件
- 如何使用Boost进程间消息队列for Windows
- 执行这些 Boost::进程间组件需要同步
- 从函数返回 boost::进程间内存映射文件
- Boost.进程检查进程是否终止
- boost::进程间更新阵列的最快方法
- 是boost::进程间线程安全的
- 将矢量或任何其他容器存储在boost进程间共享内存对象中
- Boost进程间矢量,创建多个矢量指针
- Boost进程间互斥锁崩溃,而不是等待锁