Re: sharing memory map between processes (same parent)
- From: phil-news-nospam@xxxxxxxx
- Date: 28 Apr 2008 17:53:55 GMT
On Mon, 28 Apr 2008 07:37:57 -0700 (PDT) David Schwartz <davids@xxxxxxxxxxxxx> wrote:
| On Apr 27, 1:04 pm, phil-news-nos...@xxxxxxxx wrote:
|
|> I have forked two processes from the same parent. I'd like to have one of them
|> do open() and mmap() to map a file into memory (madvise would also be used).
|> Then I would like the other process to be able to access that mapping. Is
|> there a way to get that mapping shared with another process (much like it
|> would be had the parent mapped it first then forked the two child processes)
|> or at least transfer the mapping from one process to another? Note that it
|> will not necessarily be a mapping of the entire file, and the first process
|> may be keeping the descriptor open for later mapping of another part of the
|> file. Also, it may be possible to make it so the first process never does
|> any access of the mapped pages.
|
| What's your outer problem? Why not just have the other process create
| the mapping itself? The answer to your question would be very
| different if the reason was that the mapping was private than it would
| be if the problem was that the mapping contains pointers and needs to
| be at the same address for all processes.
The idea is to have some of the work spread out between processes and avoid
having to use threads (because I don't want to share the whole VM). There
is a way to transfer (already open) file descriptors between processes. I
was hoping there might be a similar way to transfer already mapped pages
between processes. But if there is not, I will just have to do things some
other way.
| You have a habit of posting suggested solutions rather than problems.
You have a habit of being accusatory. But I've only noticed this over the
past couple years. I remember long ago your postings were more civil.
--
|WARNING: Due to extreme spam, I no longer see any articles originating from |
| Google Groups. If you want your postings to be seen by more readers |
| you will need to find a different place to post on Usenet. |
| Phil Howard KA9WGN (email for humans: first name in lower case at ipal.net) |
.
- Follow-Ups:
- Re: sharing memory map between processes (same parent)
- From: David Schwartz
- Re: sharing memory map between processes (same parent)
- References:
- sharing memory map between processes (same parent)
- From: phil-news-nospam
- Re: sharing memory map between processes (same parent)
- From: David Schwartz
- sharing memory map between processes (same parent)
- Prev by Date: Re: sharing memory map between processes (same parent)
- Next by Date: Re: sharing memory map between processes (same parent)
- Previous by thread: Re: sharing memory map between processes (same parent)
- Next by thread: Re: sharing memory map between processes (same parent)
- Index(es):
Relevant Pages
|