7 votes 7 votes Consider the following program. main() { fork(); fork(); fork(); } How many new processes will be created? 8 6 7 5 Operating System isro2015 operating-system fork-system-call + – go_editor asked Jun 19, 2016 go_editor 3.9k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 16 votes 16 votes No of child process created by $n$ fork calls in series =$2^{n}-1$ With 3 three fork process =7 Option C is correct. ManojK answered Jun 19, 2016 • selected Sep 10, 2016 by Arjun ManojK comment Share Follow See all 3 Comments See all 3 3 Comments reply cse23 commented Sep 10, 2016 reply Follow Share new processes are 7 but total processes are 8 ryt? 1 votes 1 votes ManojK commented Sep 10, 2016 reply Follow Share yes. 0 votes 0 votes AnilGoudar commented Apr 18, 2017 reply Follow Share @ManojK, Please draw the tree for fork() call, iam getting 8 child process when iam drawing tree of all fork() calls. Thank You. 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes If a program has N series of fork call then total number of processes(including parent process) will be created = 2^N. total number of child processes(New processes) = 2^N - 1 According to our Question, N=3 New processes = 2 ^3 - 1 = 7 processes akash.dinkar12 answered Apr 14, 2017 akash.dinkar12 comment Share Follow See all 0 reply Please log in or register to add a comment.