Solved

is shared memory automatically inherited to child process?

Posted on 2007-11-23
2
791 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
init script for deployment on linux machine 5 52
how does yum update work 2 48
can't run or update 'yum' on CentOS 7 7 53
Automating a set of commands run on linux 7 98
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 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…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

919 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

20 Experts available now in Live!

Get 1:1 Help Now