我具有包含在长期运行的字符串(升压::进程间:: 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
priv_is_allocated_block(block)'failed.`
总共有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;
'class SharedVector { public: boost :: interprocess :: interprocess_mutex mutex; complex_vect_type m_vect; SharedVector(常量void_allocator&A):m_vect的(a){} }' 和用于创建要这么做: 'memsegment->构建( “sharedvector”)(* m_allocator);' 而在另一进程正在执行此操作来访问它 'mem_segment-> find (t“sharedvector”)。 ' –