CS FundamentalsModerateGATE CS

A process calls fork() three times in sequence and every child also continues the code. Afterwards, how many processes exist and how many of them are children (not the original)?

  1. A. 6 and 5
  2. B. 8 and 7
  3. C. 8 and 8
  4. D. 3 and 3

Correct answer: B. 8 and 7

Each fork doubles the number of processes: 2³ = 8 in total, of which 7 were created by fork.

More Operating Systems questions

Exams that ask this topic