[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-httpd-users
Subject:    Re: [users@httpd] Child process executing tasks of parent process
From:       Will Fatherley <wefatherley () gmail ! com>
Date:       2023-09-29 19:16:35
Message-ID: CABCiJvDi12RgOktpjpdtU7uJ7VQWi7YiZn8SpFii3UnoF8hYfg () mail ! gmail ! com
[Download RAW message or body]

It's not the point of this distribution list to discuss Perl, but fork will
return the process id for both processes. A simple pattern for the source
code looks like:

pid = fork();
if (pid==0){print "do the child things";}
else {print "do parent things"}

You want to aim your script semantics according to the pid. This is because
the source code is executed by both processes.

[Attachment #3 (text/html)]

<div>It's not the point of this distribution list to discuss Perl, but fork will \
return the process id for both processes. A simple pattern for the source code looks \
like:<div dir="auto"><br></div><div dir="auto">pid = fork();</div><div dir="auto">if \
(pid==0){print &quot;do the child things&quot;;}</div><div dir="auto">else {print \
&quot;do parent things&quot;}</div><div dir="auto"><br></div><div dir="auto">You want \
to aim your script semantics according to the pid. This is because the source code is \
executed by both processes.</div> </div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic