Questions tagged [boost-interprocess]

Boost.Interprocess is a part of the C++ Boost library. It simplifies the use of common interprocess communication and synchronization mechanisms.

371 questions
0
votes
1 answer

problem in boost-interprocess library

std::pair p = managed_shm.find("Integer"); can someone provide me with the definition of this find method.
Shweta
  • 5,198
  • 11
  • 44
  • 58
0
votes
0 answers

How to determine how much shared memory to allocate?

I am creating an interprocess communication scheme using boost::interprocess. I want my shared memory area to contain some std::vectors and am doing this based on the example provided here. To communicate, I plan to put a struct like the following…
crobar
  • 2,810
  • 4
  • 28
  • 46
0
votes
2 answers

Boost.Interprocess memory location

In the Boost.Interprocess documentation Where is this being allocated? it is stated that Boost.Interprocess containers are placed in shared memory using two mechanisms at the same time: Boost.Interprocess construct<>, find_or_construct<>...…
poukill
  • 540
  • 8
  • 18
0
votes
0 answers

boost::interprocess::map compiler error "cannot be overloaded"

I am getting a compiler error trying to use boost::interprocess:map and I do not understand the error. Declaring the map and its allocator using namespace boost::interprocess; struct Order { uint64_t id = 0; uint64_t val = 0; }; typedef…
The Dude
  • 330
  • 6
  • 16
0
votes
2 answers

c++ boost interprocess exchange (copy) non-shared and shared string vector

I want to achieve what was achieved in the answer to this question, but for a vector of strings i.e. string objects. I want to be able to write common code that can be used with either heap memory or shared memory. I have emulated the code and wrote…
Dnj Abc
  • 352
  • 1
  • 4
  • 13
0
votes
1 answer

Assertion when trying to a use a Boost.Interprocess message queue across a bunch of processes

I have the following reduced program that spins up a bunch of child processes and then uses a boost::interprocess::message_queue to send a message to each one. This works when number of processes is small (about 4 on my machine) but as that number…
0
votes
1 answer

Boost::interprocess managed_shared_memory pointer effective scope

I just use boost::interprocess::managed_shared_memory to create a shared vector in memory, I have successfully created the shared memory, I find when I read the vector, it's ok to read and print all elements in the vector in comment 1, but when…
Anry Yang
  • 1
  • 2
0
votes
1 answer

Constructing object on shared memory with integer identifier

When I look at the samples of boost interprocess library, the objects are always constructed with string name. segment.construct("name")("param1", "param2"); Is it possible to construct the object with integer identifier…
penguru
  • 4,342
  • 11
  • 46
  • 56
0
votes
1 answer

Boost Container vs Boost multi_index_container

What are the advantages of the boost::container class compared to boost::multi_index_container one? They can both store their data in shared memory and work with Boost.Interprocess (crucial for me), and multi_index_container seems to provide more…
Pietro
  • 12,086
  • 26
  • 100
  • 193
0
votes
1 answer

problems with boost:interprocess shared memory

I'm having some trouble implementing boost/interprocess library for shared memory operations between two programs. This is the first I've used any shared memory operations, and I have first modified some of the sample code in the boost documentation…
brneuro
  • 326
  • 1
  • 5
  • 15
0
votes
1 answer

how to get a shmid from a boost::interprocess::managed_shared_memory object

boost::interprocess will create a shm like this: boost::interprocess::managed_shared_memory segment(boost::interprocess::open_or_create, "ContainerSharedMemory", 65536); but how can a watch this shm like this: /Tool/SHMCache$ ipcs -m key …
Dylan Wang
  • 111
  • 8
0
votes
0 answers

Unable to find vector in shared memory segment

I'm attempting to share a vector between two Windows processes which run in the same context (either both as user processes, or both as a service). I'm going by the official example which actually works just fine for me. The only difference is that…
Lucky Luke
  • 1,373
  • 2
  • 13
  • 18
0
votes
0 answers

Boost IPC: Only remove shared object when the last process is closed

I'm currently using Boost's shared memory for IPC. I only want to remove the shared memory when the last process exits. If I try to remove the object before the last process, it will change the name and it's then not possible to reopen it for…
A.Fagrell
  • 1,052
  • 8
  • 21
0
votes
0 answers

What is a good stategy to follow to provide a shared memory folder required by boost named_semaphore on windows?

I used boost's named_semaphore for IPC. We have one program/process (parent) invoking another (child). If the parent is killed (kill -9 scenario), we want the child to complete its work and exit, and the parent shall, upon starting wait until the…
Werner Erasmus
  • 3,988
  • 17
  • 31
0
votes
2 answers

Boost interprocess_mutex copy/move constructor?

I'm trying to create a vector of objects in shared memory that each own an interprocess_mutex as follows: struct test { test(){} interprocess_mutex mutex; }; using namespace boost::interprocess; managed_shared_memory seg(open_or_create,…
jondo2010
  • 71
  • 6