Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Forking vs. A New Process

by tilly (Archbishop)
on Jan 24, 2011 at 06:48 UTC ( [id://883863]=note: print w/replies, xml ) Need Help??


in reply to Forking vs. A New Process

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://883863]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-19 20:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found