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'm creating a parent-child process in C and these processes are using an array of characters as a shared memory and i want the execution to be in this sequence
parent->child->parent->child->parent->child .... and so on, i am using Wait(NULL) in parent but the execution go in the sequence of parent->child->parent->parent->parent ....
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.
How do I get a forked, execve() child process that can run 'vi', etc and redirect all IO to the parent process?
I'm trying to pass shells through from an embedded Linux process to the PC software interface connected over the network.
The IO for the shell process is packaged into app-specific messages for network transport over our existing protocol.
First, I was just redirecting IO using simply
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.
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.
I have a program that forks a process, and determine if child process should run in foreground and background. I call the signal function to handle the child signal before forking, to make sure dead child process will not turn into zombies.
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() ?