Fwd: [boost.interprocess] Are there pitfalls using managed_shared_memory?
M L via Boost-users <[email protected]> Tue, 10 Jan 2023 10:54:41 +0000
| Newsgroups | gmane.comp.lib.boost.user |
|---|---|
| Message-ID | <CACbOz=nxiiBNd7ipbrfFL16gwNemwGuqwf63Lb-jhkO0G5kgQg@mail.gmail.com> |
Are there common pitfalls when using
boost::interprocess::managed_shared_memory in order to share a
variable in the following way (Cpp,Windows OS)?
managed_shared_memory managed_shm(open_or_create, "my_shm", 1024);
// Write
int *i = managed_shm.construct<int>("Integer")(42);
// Read
std::pair<int*, std::size_t> p = managed_shm.find<int>("Integer");
- Is the shared memory deleted, when the application is stopped?
- Do other programs or services can bear with this method without crashing?
-is there a danger that shared memory could be accumulated with some
kind of overflow?
Question: what does one have to consider when using this method?
Thanks for help.