From: "Stephen Dolan" <stedolan@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Memory sharing question
Date: Sat, 24 Feb 2007 11:50:00 +0000 [thread overview]
Message-ID: <1eff86fb0702240350l2c111c2apb5639fec67b360b4@mail.gmail.com> (raw)
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
next reply other threads:[~2007-02-24 11:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-24 11:50 Stephen Dolan [this message]
2007-02-24 13:52 ` Alan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1eff86fb0702240350l2c111c2apb5639fec67b360b4@mail.gmail.com \
--to=stedolan@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®