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 ....
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.
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?
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.
So basically I want to suspend a bit the child process after it's creation, just so the parent prepare some data for it in a shared memory.
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.
Hi All,
i want to check all the child processes attached to a specific process.
Say for a example; my process is a java process. then i wanna know what are the processes attached to that java process.
at the moment i use the command # ps aux|grep java ; this gives the details about the currently running java process.
Say I've got a process using 200MB of memory, and it fork()s:
python -c "import os; data='x'*200000000; os.fork(); raw_input()"
Programs like 'top' will show each process using 200MB, with very little SHRd memory, so it appears as if the processes are using 400MB in total.