Question: Create processes A , B and C from the same code file using fork. In this case you will have a single code file where

Create processes A, B and C from the same code file using fork. In this
case you will have a single code file where the parent process can serve
as Process A, and two child processes serve as Process B and C.
Consider TWO implementations here:
(i) Process B and C are two separate child processes (using two different
forks from the parent process)
(ii) Process B and C are nested forks (here Process C is forked from
within process B and NOT from the parent process).
Deliverable: TWO different code files; one with regular forks, other one with
nested forks.
Expected Output:
10 I AM PROCESS A whose id is : 4001
20 I AM PROCESS B whose id is : 4002
30 I AM PROCESS C whose id is : 4003
Good Bye World, I am Done!!
(Note that process id may change for your program.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!