fork() in for loop

hello,

Every time i use fork() in the for loop, my college network(which i work in) either gets slow or hangs up.Can any 1 explain why it is so?

Of course there is no use of doing it though. But still i want to clear my doubt.

Thanks

fork() makes a copy of a process. If you do that in a "for" loop, you have a problem. The first time through the loop you invoke fork() and now you have two processes. Unless you have code to prevent it, both processes with continue to run that loop. On the second iteration you get 4 processes, then 8, then 16, then 32.... Anr 32 processes all forking themselves will put a nasty load on the system.

Thanks for your reply perderabo. It was a great help to me.
Take Care.bye