Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Interprocess with complex/nested classes
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2010-08-13 05:25:48


On 11/08/2010 21:33, Rick Hullinger wrote:
> I think I finally have a grasp on the basics of the boost:interprocess
> library, and I've been using it successfully when dealing with
> relatively simple classes that contain a few member variables that are
> all standard data types.
>
> However, I am now faced with the problem of pushing a rather complex
> class out into interprocess shared memory and I'm having no luck at
> all. I'm hoping someone here can help (or can steer me towards an
> alternate solution). Stripping it down to what I hope are the basics,
> I have something along these lines:

You can't share any structure that contains raw pointers, because shared
memory is mapped in different address in each process. So you need to
replace every member with boost.interprocess alternatives. And if those
structures are filled by GNu Scientifice Library, pointers would point
to process-local memory (malloc-heap) and that memory isn't shareable
with other processes.

Best,

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