Boost logo

Boost Users :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2007-01-17 15:46:28


> Dear All,

Hi,

> As it was previously possible to use */_shmem_/* shared memory allocator
> with STL containers, is it still possible to use the */_interprocess_/*
> shared memory allocator along with STL containers? If I try to use a STL
> container with interprocess shared memory allocator, I get the following
> error:

The general shmem shared memory allocator was never intended to be used
with STL containers, because I don't know about any STL implementation
that accepts allocators that define allocator::pointer types as non-raw
pointers. The only possibility was using fixed address mapping.

You can use "fixed_managed_shared_memory" instead of
"managed_shared_memory" (it's in the reference but there is no example
in the code) to achieve this. allocators created from the segment
manager produced by "fixed_managed_shared_memory" create shared memory
allocators compatible with STL implementations. Hope this helps.

Regards,

Ion


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net