Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.development.apps > #589
| From | Rainer Weikusat <rweikusat@mssgmbh.com> |
|---|---|
| Newsgroups | comp.os.linux.development.apps |
| Subject | Re: mmap for IPC |
| Date | 2013-05-02 14:42 +0100 |
| Message-ID | <87ppx933cb.fsf@sapphire.mobileactivedefense.com> (permalink) |
| References | <5b2c726f-7805-401e-8c42-9407adf6ce9f@googlegroups.com> <klrsop$k80$1@dont-email.me> |
Lusotec <nomail@nomail.not> writes:
> Jay Braun wrote:
>> Just want to make sure: If I use mmap for inter-process communication,
>> the processes that share the memory need not be forked from some parent
>> process. They can be invoked independently, correct?
>
> Yes, if the mapping is not anonymous. If the mapping is anonymous only the
> process and its children can access the anonymous mapping (see MAP_ANONYMOUS
> in man mmap).
>
> On a side note, you may want to use shm_open instead of mmap directly if you
> want to use shared memory for IPC between unrelated processes.
Quoting shm_open(3):
A POSIX shared memory object is in effect a handle which can
be used by unrelated processes to mmap(2) the same region of
shared memory.
Back to comp.os.linux.development.apps | Previous | Next — Previous in thread | Next in thread | Find similar
mmap for IPC Jay Braun <lyngwyst@gmail.com> - 2013-05-01 11:27 -0700
Re: mmap for IPC Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-05-01 20:08 +0100
Re: mmap for IPC Lusotec <nomail@nomail.not> - 2013-05-01 21:12 +0100
Re: mmap for IPC Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-05-02 14:42 +0100
Re: mmap for IPC Jasen Betts <jasen@xnet.co.nz> - 2013-05-04 09:27 +0000
csiph-web