In the Boost::Interprocess documentation and under the heading “Where is this being allocated?”; is an example of how to create a vector of strings in a managed_shared_memory segment.

 

Link to Boost::Interprocess documentation here:

 

http://www.boost.org/doc/libs/1_53_0/doc/html/interprocess/allocators_containers.html#interprocess.allocators_containers.containers_explained

 

Please could this example be extended to demonstrate;

 

1.       How to add string elements to the shared memory vector from a different process?

2.       How to access and copy strings from the shared memory vector from a different process?

 

This really would be invaluable to people trying to use Boost::Interprocess for the first time!  My particular project has ground to a halt for over a month simply trying to get a working implementation of a Boost::Interprocess mutex synchronised shared memory vector of strings.  I would like one process to add strings to the shared memory vector and several other processes to read string data from the vector.  Right now I don’t know if I’ll ever get it to work!  Running out of ideas here!

 

Hope someone can help.

 

Thanks,

 

Riskybiz.