This is a continuation of my previous question . I use fork to create a child process. Inner child, I give the command to start the process as follows:
if((childpid=fork())==0)
{
system("./runBinary ");
exit(1)
}
My runBinary has a function to measure the time it takes from start to finish.
What amazes me is that when I run runBinary right on the command line, it takes ~ 60 seconds. However, when I run it as a child process, it takes longer, for example, ~ 75 or more. Is there something that I can do or am currently doing wrong that leads to this?
Thanks for the help in advance. MORE DETAILS: I am running a linux RHEL server with 24 cores. I am measuring processor time. At that time, I only fork 8 child (sequentially), each of which is tied to a different kernel, using a set of tasks (not shown in the code). The system does not boot, except for my own program.
source
share