This program gets a sentence in parent process and prints it in upper case in child process. I want the child to wait for the parent. I used sleep() to make the child process to wait. Is there any method of making a child to wait for the parent ? Can i implement that with signal() ?
I am trying to use shm_unlink(object_path) to clear up the shared memory I opened in signal handling function. However, the code doesn't work. What goes wrong? The code basically does this: A parent process is taking two integers from user input, and fork a child to compute the sum of the two. Once the sum is computed, the child informs the parent that it's done computing sum through a pipe.
I know the fork concept.
I try to solve the problem.
I do the one fork() process and the fork() process create the one parent and child.
If I run the program and i put the arguments of the commands.
Dear All,
I am new to this community and this is my first post. I am facing an issue where the process starts hanging. When I closely look at the logs I come to know that some of the child processes that are forked by the parent process are not finished. Regarding this I have a few questions:
I understand that a process (parent) can be pinned to a core using sched_setaffinity and then the forked process inherits the affinity and would also be pinned on the same core. However, I don't want to keep them pinned together to the same core forever. Ideally, what I want is for them to stay together on the same CPU i.e.
The parent process fails with errno=12(Out of memory) when it tries to fork a child. The parent process runs on Linux 3.0 kernel - SLES 11. At the point of forking the child, the parent process has already used up around 70% of the RAM(180GB/256GB). Is there any workaround for this problem?
The application is written in C++, compiled with g++ 4.6.3.
I know the fork concept. I try to solve the problem.
I do the one fork() process and the fork() process created the one parent and child. If I run the program and i put the arguments of the commands.
This is a very basic question. The parent process will create some shared memory where it will put two integers in there, then it forked a child which will go to the shared memory and compute the sum of them. All this is fine, but how would the child inform the parent that it's done computing the sum? Do I need to create a pipe between the two processes to do this?
In my C program, I keep a struct linked list as a global variable.
Then later I fork a child process. Now in the child process if I free a node of the linked list, and then end the child process. Will the node be gone in the parent process as well?
When I was trying this, it seems the node was still there in the parent process...
Is this right? Why?