EmbLogic's Blog

relatin b/w fork() &n execl..

Trying to use execl b/w server and processing clients without fork();

O/P–>block on read or write will definitely occur on server-pro_client side…….

When we use fork( ) to create a child process the child process
does not contain the entire data and code of the parent process.
Then

Does it mean that the child process contains the data and code below the fork( ) call???????

Even this is not so. In actuality the code
never gets duplicated. Linux internally manages to intelligently
share it. As against this, some data is shared, some is not. Till the
time both the processes do not change the value of the variables
they keep getting shared. However, if any of the processes (either
child or parent) attempt to change the value of a variable it is no
longer shared. Instead a new copy of the variable is made for the
process that is attempting to change it. This not only ensures data
integrity but also saves precious memory.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>