In this project, you need to learn how to create, execute, and terminate process
ID: 3672432 • Letter: I
Question
In this project, you need to learn how to create, execute, and terminate processes in Unix. You should develop a Unix program for the project that can run several processes at the same time. Let's call the initial process executed by the program Process A. Process A creates two other child processes: Process B and Process C. Process B also creates two child processes: Process D and Process E. Each process should have an output announcing that it has started execution. Have the life of each of these processes be long enough (e.g. 30 sec) so that you can observe them while they are still executing.
Explanation / Answer
This below c program will crate the Processe as per given in probelm statement..See the below c code for getting listed process..
#include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
int main() {
pid_t pid, pid1;
pid = fork();
if (pid == 0)
{
printf("Process A- ");
pid1 = fork();
if(pid1 == 0)
printf("Process D");
else
printf("Process E");
}
else
{
printf("Process C");
}
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.