Solved

is shared memory automatically inherited to child process?

Posted on 2007-11-23
2
824 Views
Last Modified: 2012-08-13
Hi,

I have a question about a shared memory.
If a parent process gets and attaches a segment of shared memory and then forks a child, would the child process have an access to this shared memory????

Or do I need to explicitly attach this shared memory segment to the child process??
 
0
Comment
Question by:shinymoon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
PCableGuy earned 500 total points
ID: 20341539
Yes, the child has access to the same shared memory as the parent. In fact, shared memory is considered a form of interprocess communication. No need to attach the memory to the child. However, you still need to avoid the problem of the parent and child (or other child processes) writing to same memory location - in that case you need to use semapores too.

http://www.csl.mtu.edu/cs4411.ck/www/NOTES/process/shm/what-is-shm.html

Also check the section here called "Attaching a Shared Memory Segment to an Address Space"
http://www.ccse.kfupm.edu.sa/~akbar/ICS431_032/LabExercises/Lab13/Lab13.html


0
 

Author Comment

by:shinymoon
ID: 20341551
Thank you so much for the clear answer and great website!!! It helped me a lot.
Thank you!!!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question