I have a multi index in shared memory.
I need to dump the content of multi index to csv.
So each action on the multi index is protected by a mutex lock.
So the way i did the dump, is lock the mutex, loop through a specific list index and write entries to file.
The problem is that it takes too much time. Is there a way (and will it be faster) to copy the shared memory content, free the mutex, and then analyze the copied memory? I didn't find how to copy the shared memory content if possible (as it is not a POD type)
m_pSegment->find_or_construct<MultiIndexType>("MultiIndex")(
typename MultiIndexType::ctor_args_list(),
typename MultiIndexType::allocator_type(m_pSegment->get_segment_manager()));
find_or_construct return the memory pointer.
Here is a link to code http://coliru.stacked-crooked.com/a/09ea79752512fad8
In coliru no output perhaps because it is in shared memory.