Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.apps > #589

Re: mmap for IPC

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Rainer Weikusat <rweikusat@mssgmbh.com>
Newsgroups comp.os.linux.development.apps
Subject Re: mmap for IPC
Date Thu, 02 May 2013 14:42:44 +0100
Lines 19
Message-ID <87ppx933cb.fsf@sapphire.mobileactivedefense.com> (permalink)
References <5b2c726f-7805-401e-8c42-9407adf6ce9f@googlegroups.com> <klrsop$k80$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace individual.net sbpe67xjQpOrF+1qZt07xgdwyGuk1BsLiR1sWpJEVMSyDBths=
Cancel-Lock sha1:axhdhFXEEYb/C/10jhC2GvqYG6M= sha1:U+Q00kS/lVI81ZPaf6f+OWl6wt8=
User-Agent Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)
Xref csiph.com comp.os.linux.development.apps:589

Show key headers only | View raw


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 | NextPrevious in thread | Next in thread | Find similar


Thread

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