I have created a Boost Shared memory, for the purpose of sharing vectors.
The sharing has been accomplished.
However, I do not understand how the vectors are pushed into shared memory.
I do a push_back
to the shared memory from the writing process. So the vectors are being pushed like a stack push
into the shared memory, in LIFO order?
The other application, the reader, retrieves the vector in the following fashion :
managed_shared_nmemory segment (open_only, "Shared_mem_name");
Vector = segment.find<VECTOR_TYPE>("Vector_name").first;
if (Vector != NULL)
{
//CODDE
}
Now here, which vector am I reading. the one pushed in last ( newest one )? And if I'm reading it, does it imply the vector is popped? i.e. is it still there in the shared memory after the read, and if so, will the shared memory overflow after a time, and how would I stop it? I don't see anything in the documentation regarding it...