Boost logo

Boost Users :

Subject: Re: [Boost-users] Creating interprocess::shared_ptr across processes
From: GxL (gabriel.levy_at_[hidden])
Date: 2011-04-18 18:20:57

 <Viatcheslav.Sysoltsev <at>> writes:

> When process dies unexpectedly nobody guarantees your destructors are
> called, but shared memory remains - this alone should let you rethink your
> idea. As a rule of thumb I'd advise placing only plain POD-composed
> structures in shared memory and never rely on the state of the shared
> memory on startup before some kind of handshake with the counterparts.

Thanks Slava.
Good points and I'm providing for handshaking between the participants and not
relying on the shared mem. states alone.
While the point is valid about the unexpected death of the process, I still find
a gap in the knowledge of how the interprocess::shared_ptr is expected to be
used across the processes.
On my side I've been first exploring/assessing how the interprocess Shared
Memory works (including the usefulness of shared_ptr/weak_ptr) before making
design decisions.
I don't like making premature design decisions just because of some gap in
understanding about some library - you know what I mean :).
Nonetheless thanks for the points :).

If there is anyone who can show me how to use interprocess::shared_ptr with
managed_external_buffer and ensure that the two sides would share the same
shared_count I would be very grateful.
Thanks in advance.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at