Shared memory and IPC

Wez Furlong wez at thebrainroom.com
Fri Sep 7 01:56:06 GMT 2001


On 06/09/01, "John E. Malmberg" <malmberg at Encompasserve.org> wrote:
> > > Memory allocated using the COM IMalloc must
> > > be passable directly to another process (ie: appear at the same address),
> > > so I think we might need a COM-wide shared memory context of some kind.

> Is there some way that relative pointers can be used inside the shared
> memory, and the functions that access the pointers know what the base
> address is?

Yes (as others have discussed), but for the purposes of the COM MEMCTX_SHARED
IMalloc, if we implement it at all, it must work such that the allocated
pointer works in all address spaces (because it could be passed anywhere!).
Now, if the person using it is stupid enough to put a pointer to somewhere
that's not accessible inside something in that shared mem, their program
deserves to get a sigsegv or sigbus!

It's looking like a right PITA, so I'm moving it down on my todo list.

However, using shared memory to speed up marshalling seems like a good way to
go (performance wise); it's staying at about the same place on my todo :)

--Wez.





More information about the samba-technical mailing list