141k views
1 vote
How do you prevent a process B, that was forked from parent process A, from becoming a zombie? Choose one of the following:

1) By having the parent process A wait() for process B
2) By having the child process B wait() for the parent process A
3) By forking process A again, creating another child C

User Max Teflon
by
7.1k points

1 Answer

5 votes

Answer:

3) By forking process A again, creating another child C

Step-by-step explanation:

To prevent a process B, forked from a parent process A from becoming a Zombie, you have to make sure that the parent process A calls wait for every child process that terminates. We can also fork the process A again, and have the immediate child process B exited immediately.

User Keyanna
by
8.0k points