Don't ask to ask, just ask | |
PerlMonks |
is sharing variables between forked process possible??by sagar_kempe (Initiate) |
on Feb 17, 2006 at 06:53 UTC ( [id://530871]=perlquestion: print w/replies, xml ) | Need Help?? |
sagar_kempe has asked for the wisdom of the Perl Monks concerning the following question:
The steps for the script are as below: 1. Fork the main process into Child & Parent processes. 2. Child (PID ==0) will do some processing (testing that can be conformance or use case anything) 3. Meanwhile parent will run a timer that will have a count set at starting of script 4. If the child process completes before the final count then we have to stop the timer that runs on the parent process 5. If the Child process does not complete before the count (i.e in case the child process hangs) then the parent process will kill the child process. I dont have any problem executing step 5. That works totally fine. The only problem is to execute step 4 that Im not able to stop the timer on parent process if the child process completes before timer reaches its final count. The parent has to stop the timer if the child process ends before the timer reaches final count.
Edited by planetscape - fixed code tags
Back to
Seekers of Perl Wisdom
|
|