I am having a boost interprocess vector which contains string (boost::interprocess::basic_string) as values kept in shared memory, I am getting this error in long run
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.`
There is total 6 process writing to this vector and one process popping the data out.
Questions:
- Is there any limitation in number of process accessing a shared memory, especially boost managed containers.
- What I understand is that the segment manager and mem algorithm is kept in the shared memory itself, Is it correct?
I use this class:
class SharedVector {
public:
boost::interprocess::interprocess_mutex mutex;
complex_vect_type m_vect;
SharedVector(const void_allocator &a) : m_vect(a) {}
};
and for creation am doing this:
memsegment->construct<SharedVector>("sharedvector") (*m_allocator);
and in the other process am doing this to access it
mem_segment->find<SharedVector>(t"sharedvector").first;
class SharedVector { public: boost::interprocess::interprocess_mutex mutex; complex_vect_type m_vect; SharedVector(const void_allocator &a) : m_vect(a) { } }
and for creation am doing this :memsegment->construct<SharedVector>("sharedvector") (*m_allocator);
and in the other process am doing this to access itmem_segment->find<SharedVector>(t"sharedvector").first;
- Lasya Latha