Which process terminates first ? Child or Parent?

137 views Asked by At

I created a child process using fork system call. Which process will finish first ? And when does a process become zombie process?

1

There are 1 answers

0
Tony Tannous On

A zombie process is a process that has finished and its parent is yet to wait on its return value.

What die first ? Depends on scheduling algorithm. It might be the parent and it might be the child who is selected to run and also depends on how much time they need in CPU...

HOWEVER, If parent process waits (look wait system call) for child process, then child process will finish first.