Boost.Interprocess is a part of the C++ Boost library. It simplifies the use of common interprocess communication and synchronization mechanisms.
Questions tagged [boost-interprocess]
371 questions
3
votes
1 answer
Inserting a boost vector inside a boost map in shared memory
This is what i have so far. But this doesnt even compile. What should i do to make it work?
typedef allocator vecAllocator;
typedef vector vec;
typedef std::pair…

Prasanth Madhavan
- 12,657
- 15
- 62
- 94
3
votes
1 answer
slow memory allocation in boost-interprocess
It looks like this:
MyType * pMy = my_segment->construct(anonymous_instance)();
my_segment->destroy_ptr(pMy);
Where MyType is some typical struct and my_segment is correctly constructed boost::interprocess::managed_shared_memory *
is around…

Yordan Pavlov
- 1,303
- 2
- 13
- 26
3
votes
1 answer
boost::unordered_map using boost::interprocess::cached_node_allocator compilation failure
I am trying to create a boost::unordered_map in a boost::interprocess::managed_shared_memory segment. This works fine until I try to change from using boost::interprocess::allocator to boost::interprocess::cached_node_allocator.
It seems that the…

Lenny
- 31
- 1
3
votes
1 answer
Looking for simple example of Boost message_queue and serialization usage
Anyone can share small working example of using together boost message_queue and serialization? I want use classes to exchange data between processes but stuck in my research.

rimas
- 757
- 2
- 8
- 18
3
votes
2 answers
How to release boost::interprocess::named_mutex when the process crashes
I used boost::interprocess to create a boost::multi_index data structure in shared memory. There are many client processes that will access this data structure. When accessing, I will lock the data structure. The problem I encountered is Once the…

ben
- 59
- 5
3
votes
1 answer
Boost Interprocess mutexes and condition variables
I'm looking at this Boost example code for two processes sharing a mutex and condition variable between them:
https://www.boost.org/doc/libs/1_57_0/doc/html/interprocess/synchronization_mechanisms.html
but I don't understand how the mutex-condition…

intrigued_66
- 16,082
- 51
- 118
- 189
3
votes
0 answers
boost interprocess file_lock understanding/usage
I have been having issues using an anonymous mutex (boost::interprocess::interprocess_mutex) in a boost::interprocess::managed_shared_memory instance. Namely, issues arise if the software crashes; the mutex may remain locked (depending on its state…

ZeroDefect
- 663
- 1
- 8
- 27
3
votes
1 answer
How get list of named objects in boost interprocess shared memory
According to guide on Boost docs
It is possible to create named vectors of some type (for instance double)
using namespace boost::interprocess;
typedef allocator ShmemAllocator;
…

user2614242
- 177
- 1
- 2
- 9
3
votes
2 answers
Does vector resize throwing bad_alloc invalidate the original data?
After std::vector::resize() throws a std::bad_alloc exception, is the original data still valid and accessible in the std::vector object?
Does the answer hold for other allocators, e.g. if boost::interprocess::allocator is used as the allocator, and…

ezod
- 7,261
- 2
- 24
- 34
3
votes
1 answer
What am I doing wrong with my semaphores (named_semaphore from Boost)?
Abstract
I present a small example of code reproducing a very strange bug I have in my software. It creates 3 named semaphores with Boost, and waits for each in a single thread. This works. But if I change the names of the semaphores (by adding a…

Caduchon
- 4,574
- 4
- 26
- 67
3
votes
1 answer
Boost interprocess: Is there possibly an internal deadlock condition?
I'm using boost interprocess for a shared memory application, and I feel like it handles process termination very poorly.
For example, I create a certain data object and store it in memory, with the name map_name. Then, I run this code:
void…

CJ Cobb
- 105
- 5
3
votes
1 answer
boost::interprocess ubuntu exception on creating managed shared memory object
I am newbie in boost. I am trying to use shared memory to communicate between processes using boost.
It works perfectly on my windows using vs2010 with 4 processes sharing memory with a manager. The manager initiates the shared memory mechanism…

user1130254
- 155
- 2
- 9
3
votes
0 answers
shared memory vector, allocating strings with 8 byte alignment in 32 bit
I'm using boost shared memory to share data between 32bit and 64bit processes.
Under 64bit everything works fine, but under 32bit I get a compilation error whenever I need to allocate new elements to a vector. string alone works without…

user23573
- 2,479
- 1
- 17
- 36
3
votes
2 answers
Is try_lock() +unlock() valid way to check whether boost::interprocess::file_lock is locked?
I need to check whether a file is locked using boost::interprocess::file_lock. I produced this, but I'm worried what it's gonna do:
bool DataCache::isLocked() const {
bool res = lock_->try_lock();
if(res)
lock_->unlock();
return…

Tomáš Zato
- 50,171
- 52
- 268
- 778
3
votes
3 answers
Shared lifecycle cross processes with boost::interprocess::shared_ptr
I'm trying to use the boost::interprocess in order to share data between processes and utilize the shared_ptr for lifecycle management. I have a map residing in the shared memory and two processes should access it.
…

Matija Lukic
- 81
- 6