3,401 views

8 Answers

3 votes
3 votes
Total child process = 2^n -1  , where n is number of time fork will call

 

2^2-1 =3
0 votes
0 votes
here fork() fnction is executing twice and n=2.

we the nos of child processes are  (2^n)-1= (2^2)-1=4-1=3
0 votes
0 votes
Generally when a fork is called for n times then total number of child processes that is generated is 2^(n)-1

In the above problem it is called 2 times so it generates 2^(2)-1 =3 number of child processes will be generated.
0 votes
0 votes
No of child processes created is 2^n-1.

Here n is the number of times fork is called.

Related questions

0 votes
0 votes
1 answer
2
admin asked Oct 25, 2019
2,845 views
Five jobs are waiting to be run. Their expected run times are $9, 6, 3, 5,$ and $X$. In what order should they be run to minimize average response time? $($Your answer wi...
0 votes
0 votes
1 answer
4