Solved

is shared memory automatically inherited to child process?

Posted on 2007-11-23
2
782 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
2 Comments
 
LVL 12

Accepted Solution

by:
PCableGuy earned 500 total points
Comment Utility
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
Comment Utility
Thank you so much for the clear answer and great website!!! It helped me a lot.
Thank you!!!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now