Keep It Simple, Stupid | |
PerlMonks |
Re: Forking vs. A New Processby tilly (Archbishop) |
on Jan 24, 2011 at 06:48 UTC ( [id://883863]=note: print w/replies, xml ) | Need Help?? |
It seems to me that you need to clarify your understanding of how forking and zombies work on Unix-like systems. When you fork(), what you do is split the process into two. Thanks to copy-on-write, the two processes share most of their memory and don't take a lot of resources. Initially one copy is the child and the other is the parent, and the only thing different is one bit saying which is parent and child. (Differences tend to accumulate fairly quickly after that.) A zombie is a process that has called exit, but whose parent process has not looked at it to reap its status. Preventing zombies is a question of having parents pay attention to the signals from their children. (Or killing the parents, which causes ancestor processes to take responsibility, eventually terminating in the almighty init.) Anything you want to do with priorities, you have to do. For instance using setpriority.
In Section
Seekers of Perl Wisdom
|
|