我具有包含在長期運行的字符串(升壓::進程間:: 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」)。 ' –