Professional Documents
Culture Documents
Experiment 5
Experiment 5
Lab Exercise(s):
Output:
2. Write a program using system calls for operation on processes to
create a hierarchy of processes. Also, simulate process p4 as orphan
and p5 as zombie.
Output:
3. Write a program using system calls for operation on processes to
create a hierarchy of processes. Also, simulate process p4 as orphan
process and p7 as a zombie.
Viva Questions:
1. What is the difference between orphan and zombie processes?
An orphan process is formed when it's parent dies while the process
continues to execute, while zombie process is a process which has
terminated but it's entry is there in the system.
5. Which system call causes the parent process to stop until the child
completes the execution.
The wait system call blocks the caller until one of its child process
terminates. If the caller doesn't have any child processes, wait returns
immediately without blocking the caller. Using wait the parent can obtain
the exit status of the terminated child.