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
4
votes
2 answers

boost interprocess map with int and string

I have the following code that saves a map into shared memory using boost interprocess using namespace boost::interprocess; //Shared memory front-end that is able to construct objects //associated with a c-string. Erase previous shared memory…
Prasanth Madhavan
  • 12,657
  • 15
  • 62
  • 94
4
votes
2 answers

Reading Shared Memory from x86 to x64 and vice versa on OSX

If I create a SM from 64 bit application and open it on 32 bit application it fails. //for 64 bit shared_memory_object( create_only, "test" , read_write) ; // for 32 bit shared_memory_object (open_only, "test", read_write); file created by…
RLT
  • 4,219
  • 4
  • 37
  • 91
4
votes
2 answers

boost::interprocess::basic_string as std::string

I am trying to replace a class method which returns const std::string & with const boost::interprocess::basic_string &. The main challenge I am facing is the incompatibility between the two classes despite their implementation similarity. For more…
Yordan Pavlov
  • 1,303
  • 2
  • 13
  • 26
4
votes
1 answer

Boost iostream: how to turn ifstream into memory mapped file?

What I want is simple to open file for reading as memory mapped file - in order to access it with much more speed in future (example: we open file read it to end, wait and read it again and again) Meanwhile I want that file to be modifiable by other…
Rella
  • 65,003
  • 109
  • 363
  • 636
4
votes
3 answers

Fast communication between C++ and python using shared memory

In a cross platform (Linux and windows) real-time application, I need the fastest way to share data between a C++ process and a python application that I both manage. I currently use sockets but it's too slow when using high-bandwith data (4K images…
poukill
  • 540
  • 8
  • 18
4
votes
1 answer

Is boost::managed_shared_memory using a file on my hard drive?

When I create a new boost::interprocess::managed_shared_memory, I can see a file appear in C:\ProgramData\boost_interprocess\1571641094\NAME_OF_SHARED_MEMORY which size seems to match that of the shared memory created. My understanding from the…
Norgannon
  • 487
  • 4
  • 16
4
votes
0 answers

boost managed shared memory construction ends up with "bus error"

I have a code that is going to create a big segment on managed shared memory using c++ boost (about 2 Gigs). And if we don't have enough memory on the machine, it will receive bus error. Actually, the error happens when I try to write on shared…
rezaebrh
  • 424
  • 2
  • 6
  • 19
4
votes
1 answer

Using a memory mapped file for persistence - is volatile required?

I need persistence of a uint64_t tag across restarts. To achieve this I am using boost::interprocess::mapped_region to memory map a file which I create in the same process: bip::file_mapping file(filename.c_str(), bip::read_write); auto region =…
Steve Lorimer
  • 27,059
  • 17
  • 118
  • 213
4
votes
1 answer

Maps of maps allocated in shared memory

Inside a boost::interprocess::managed_shared_memory, I am trying to create boost::unordered_map inside another boost::unordered_map as value, having key as std::string for both maps. This Map in Map inside a shared memory segment gets accessed by…
DragonX
  • 371
  • 2
  • 6
  • 18
4
votes
1 answer

spsc_queue over shared_memory

I tried several hours, and this problem almost drives me crazy. I want create a spsc_queue over shared memory, and each element in the queue is a mq_item_t structure below. typedef struct _mq_item_t{ mq_item_type type; union { …
Mr.Wang from Next Door
  • 13,670
  • 12
  • 64
  • 97
4
votes
1 answer

Boost interprocess unordered_map compilation

I'm using boost 1.53 and GCC 4.1.2. I've tried to use boost unordered_map in some tests (documentation says, that it should work with shared memory), but i'm unable to compile my code. With interprocess::map instead of unordered everything is…
4
votes
2 answers

Boost.MultiIndex: Are there way to share object between two processes?

I have a Boost.MultiIndex big array about 10Gb. In order to reduce the reading I thought there should be a way to keep the data in the memory and another client programs will be able to read and analyse it. What is the proper way to organize it?…
Arman
  • 4,566
  • 10
  • 45
  • 66
4
votes
1 answer

Why is creating a ring buffer shared by different processes so hard (in C++), what I am doing wrong?

I am being especially dense about this but it seems I'm missing an important, basic point or something, since what I want to do should be common: I need to create a fixed-size ring buffer object from a manager process (Process M). This object has…
4
votes
2 answers

boost::interprocess::managed_shared_memory crashes program

My goal is to create a template singleton class called SharedMemory that can store a given data structure in a map in shared memory using boost::interprocess::managed_shared_memory. #ifndef SHARED_MEMORY_H_ #define SHARED_MEMORY_H_ #include…
andre
  • 7,018
  • 4
  • 43
  • 75
3
votes
2 answers

File based look-up table

You need an array of 10^10 4-byte integers to be used as a look-up table. Loading it to RAM would take 40GB, which isn't feasible. You never need to write to this array after it has been initialized. You need to read individual integer values from…
zeroes00
  • 531
  • 3
  • 16