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
6
votes
3 answers

Convert boost::container::boost basic_string to std::string

Is there a simple way to do this? I've tried the following: typedef allocator CharAllocator; typedef boost::container::basic_string, CharAllocator> …
wizurd
  • 3,541
  • 3
  • 33
  • 50
6
votes
1 answer

What does boost interprocess file_lock actually do with the target file?

I've done some reading about boost::interprocess::file_lock and it seems to do pretty much what I'm after (support shareable and exclusive locking, and being unlocked if the process crashes or exits). One thing I'm not sure about though, is what…
Dave F
  • 973
  • 9
  • 19
6
votes
2 answers

boost::interprocess::named_mutex vs CreateMutex

I want to switch from CreatMutex to boost::interprocess::named_mutex to limit my application to a single instance. Both methods works when the application runs and ends just fine. However, the lock is not released when the application crashes and…
andre
  • 7,018
  • 4
  • 43
  • 75
6
votes
1 answer

Is it safe to use boost::optional in interprocess memory?

Please consider following struct: struct ThingThatWillGoInSharedMemory { boost::optional opt_value; }; I'm using boost::interprocess to create the shared memory area. My understanding of boost::optional was that it was a discriminated…
Benedict
  • 2,771
  • 20
  • 21
5
votes
2 answers

Is boost::interprocess threadsafe?

Currently, I have 2 processes that communicate using the message_queue and shared_memory form boost. Everything work as attended. Now I need to make one of this process multi threaded (thanks to boost again), and I was wondering if I need to use…
Tom97531
  • 512
  • 7
  • 14
5
votes
1 answer

Boost message queue

I have the following boost::interprocess::message_queue related question. As intended I plan to share a message queue between >= 2 processes. Obviously one of them may crash while inside the message queue. As result it will hold the internal locks,…
Yordan Pavlov
  • 1,303
  • 2
  • 13
  • 26
5
votes
3 answers

Which is faster for IPC sharing of objects -ZeroMQ or Boost::interprocess?

I am contemplating inter-process sharing of custom objects. My current implementation uses ZeroMQ where the objects are packed into a message and sent from process A to process B. I am wondering whether it would be faster instead to have a…
L.Koh
  • 109
  • 1
  • 8
5
votes
1 answer

managed_shared_memory vs windows_shared_memory

I am currently looking at the documentation for Boost's interprocess library, and am trying to figure out what the difference is. From all I can tell the only difference is the persistence (windows shared memory is released when the last process…
SinisterMJ
  • 3,425
  • 2
  • 33
  • 53
5
votes
1 answer

Can Boost Container vector manage memory through non raw pointers?

I have a pointer-like struct that goes in the place of a pointer. The difference with a pointer is that it has extra information that the (also special) allocator can use to deallocate the memory. This pointer-like structure works well for all…
alfC
  • 14,261
  • 4
  • 67
  • 118
5
votes
2 answers

How serialize a boost::function to send it in a message_queue

I am actually trying to serialize a boost::function using boost::serialize because I want to share it in a boost::interprocess::message_queue. I only see one way to do that, it is to use the non-intrusive version of boost::serialize. namespace boost…
5
votes
1 answer

boost interprocess managed shared memory raw pointer as a class member

What I want is to access the data info of an managed shared memory object using a class named ShmObj with the raw pointer to the shared objects as private member, as code blocks below. My problem is the main program segmentation fault. I guess the…
ZFY
  • 135
  • 12
5
votes
1 answer

Problem creating a circular buffer in shared memory using Boost

I am trying to create a circular buffer in shared memory using Boost circular_buffer and Interprocess libraries. I compiled and ran the the example given in the Interprocess documentation for creating a vector in shared memory with no problem.…
recipriversexclusion
  • 13,448
  • 6
  • 34
  • 45
5
votes
1 answer

Is there a C# equivalent to boost::interprocess::basic_string?

In C++, using boost::interprocess you can define a boost::interprocess::basic_string which is basically an abstraction over a string that's stored in a Memory Mapped File. You can seamlessly use it like any other string in your application (assuming…
Omer Raviv
  • 11,409
  • 5
  • 43
  • 82
5
votes
1 answer

Boost interprocess allocator - manage file size

At first I will outline the domain with source. namespace bip=boost::interprocess; typedef bip::allocator allocator; typedef bip::vector vector; bip::managed_mapped_file…
Dejwi
  • 4,393
  • 12
  • 45
  • 74
5
votes
2 answers

How to implement platform independent asynchronous write to file?

I am creating a program that will receive messages from a remote machine and needs to write the messages to a file on disk. The difficulty I am finding lies in the fact that the aim of this program is to test the performance of the library that…
1 2
3
24 25