On 12/15/2010 01:01 PM, Chaitannya Mahatme wrote:
Hello Everyone,

I tried finding answer to this question in many books but never quite
got a satisfactory answer to this question.

A fork process would replicate it parent, my question is

   1. Why is fork necessary to create a process. Why replicate a
      existing process before creating a new process.

That is not the only thing fork is used for.

Type "pstree" on any server system, and you will typically
see multiple instances of the same server, for example the
kernelnewbies.org server has this right now:

     ├─httpd─┬─11*[httpd]
     │       └─httpd───4*[python]

In this case, you can see that the parent httpd process
forked off 12 children, one of which forked off 4 python
processes (the fcgi moinmoin instances).


The question on how to avoid duplicating the entire process
before exec has been answered elsewhere in the thread :)


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to