MNS
MNS

Reputation: 1394

C++ Container that can be Shared Across Process

I am really curious to know whether there is any stl/boost/custom etc implementation of a container (map,vector, list etc) that can be used across multiple process.

Upvotes: 0

Views: 237

Answers (1)

paxdiablo
paxdiablo

Reputation: 881553

First, there is no STL, what was once the STL is now just the C++ standard library (actually there is still an STL but what most people mean when they say STL is the standard library).

And there is nothing in the standard library that gives you this cross-process capability. That's not to say they won't work cross-process if you place them into, for example, shared memory, but that's not really built in to the collection.

And you could no doubt persist the data to disk but that's not really shared amongst processes in the sense you seem to mean.

Boost does give you the interprocess stuff, which contains code for collections mirroring that found in C++, such as the vector, deque and list.

I have no doubt there may be some custom ones around somewhere but, at that level of interaction, most people would just opt for a database system, as it provides cross-process data quite easily, with all the useful stuff like race condition prevention, and so on.

Upvotes: 3

Related Questions