I need a vector container to be shared between two threads of the same process, providing mutex protected access for the following methods:
empty
size
erase
push_back
I would also like the collection to provide an iterator which locks the container while the iterator is in use. Essentially I am looking for a collection with a std::vector<...> interface but with concurrent access protection but I can’t seem to find anything.
Are the boost::interprocess containers suitable for this application? If not, is there an alternative which is more suitable or do I have to write my own?
The answer is yes – it is suitable. See here