mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Memory sharing question
@ 2007-02-24 11:50 Stephen Dolan
  2007-02-24 13:52 ` Alan
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Dolan @ 2007-02-24 11:50 UTC (permalink / raw)
  To: linux-kernel

Hi.

I'd like to know if it is possible to get two processes to share a
memory segment at the same address, e.g. both mmap() the same file and
have it return the same address in both.

This could be done by mmap()ing it in one of them, communicating the
address to the other (via a socket or whatever), which then mmap()s it
with the address as the "start" parameter and MAP_FIXED. However, that
tends to fail, and MAP_FIXED can have annoying side-effects (killing
off other mappings).

Is it possible to reliably make the same address in two different
processes point to the same bit of physical memory?

The point of all this is that I want to pass a large, complex (full of
pointers) data structure to a different process, and I don't want the
overhead of serialising it down a socket and then parsing it at the
other end (the data structure's pretty big, and the other process
won't need it all). Is this possible?

Thanks,
Stephen Dolan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-24 12:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-24 11:50 Memory sharing question Stephen Dolan
2007-02-24 13:52 ` Alan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®