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 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() ?
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?
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.
According to wikipedia (which could be wrong)
When a fork() system call is issued, a copy of all the pages corresponding to the parent process is created, loaded into a separate memory location by the OS for the child process. But this is not needed in certain cases.
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 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'm coding a basic shell in C, and I'm working on suspending a child process right now.
I think my signal handler is correct, and my child process is suspending, but after that, the terminal should return to the parent process and that's not happening.
The child is suspended, but my shell isn't registering any input or output anymore.