Unix Programming - mmap with fork

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > July 2004 > mmap with fork





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author mmap with fork
Tejas Arun Kokje

2004-07-28, 6:19 pm

Hello

Can some body provide a sample code which uses mmap I/O to pass messages
from from child process to parent

thanks

Tejas Kokje
Barry Margolin

2004-07-28, 6:19 pm

In article <pan.2004.07.27.20.24.49.31497@usc.edu>,
Tejas Arun Kokje <kokje@usc.edu> wrote:

> Hello
>
> Can some body provide a sample code which uses mmap I/O to pass messages
> from from child process to parent


You do it the same way as you would if they weren't related at all. If
two processes mmap() the same file, what one process writes to the
memory region will be seen by the other.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Frank Cusack

2004-07-28, 6:19 pm

On Wed, 28 Jul 2004 01:12:33 -0400 Barry Margolin <barmar@alum.mit.edu> wrote:
> In article <pan.2004.07.27.20.24.49.31497@usc.edu>,
> Tejas Arun Kokje <kokje@usc.edu> wrote:
>
>
> You do it the same way as you would if they weren't related at all. If
> two processes mmap() the same file, what one process writes to the
> memory region will be seen by the other.


For MAP_SHARED.

/fc
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com