1 votes 1 votes Assume that a certain process executes the following code segment. for (i =0, i <=8, i++ ) fork() ; The number of new processes created is _______ Operating System tbb-os-2 numerical-answers + – Bikram asked Dec 26, 2016 • edited Nov 19, 2018 by go_editor Bikram 530 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes Here fork is called 9 times, hence number of child process created is (2^9 - 1) = 512 -1= 511 Bikram answered Dec 26, 2016 Bikram comment Share Follow See all 8 Comments See all 8 8 Comments reply Show 5 previous comments Bikram commented Jan 21, 2017 reply Follow Share @bad use this formula here 2n - 1 and subtract 1 for root node. think it like a full binary tree. read https://www.quora.com/If-fork-system-call-is-called-n-times-then-how-many-childs-are-created 0 votes 0 votes bad_engineer commented Jan 21, 2017 reply Follow Share I meant the question doesn't say child process it says new process so why root node(parent node) is not inlcuded??? 0 votes 0 votes Bikram commented Jan 21, 2017 reply Follow Share new process means child process , if not stated. It is taken this way only. 0 votes 0 votes Please log in or register to add a comment.