Question: Problem A. Consider the following code segment, a) How many unique processes are created? A tree of processes (only one node per process) rooted at

Problem A. Consider the following code segment, a) How many unique processes are created? A tree of processes (only one node per process) rooted at the initial parent process must be plotted to illustrate your answer to receive any point for this problem, where process ID must be shown as PO, P1, P2, etc. How many unique child threads are created? Thread nodes (one node per thread) must be added to the process tree plotted above for a) to illustrate your answer to receive any point for this problem, where thread ID must be shown as TO, T, etc. b) Hint: each process node always represents a parent thread that does or does not create child thread(s); a grandchild thread, if any, is considered to be a child thread.) int main0 pid t pid pthread t tid; pthread_attr_t attr char input 20 pid fork0: if (pid 0) * child process/ fork0 thread_create(&tid, &attr, runner, input); fork0 void *runner(void *param) t ok,teror process r hrad creation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
