Search code examples
cprocessforkminix

Total user number of user processes in Minix 2.0.4


I am trying to figure out the total number of user processes that Minix 2.0.4. I wrote a program that will perform forks until the forks fail and forks fails after 14 forks are executed and paused. So I think it would be 16 total user processes including the program executing the code and the shell. Can anyone provide me with verification on this? Thanks in advance.


Solution

  • If you call fork in a loop, and do not limit the children from forking themselves, each child will call fork as well, and so on until no more processes can be created. The actual number of processes will then be much more than counted in the topmost parent process.