0

I have a requirement as follows. My Perl program calls two shell programs (say Pro1.sh and Pro2.sh) such that

  1. Run Pro1.sh
  2. Wait for 2 minutes, then start running Pro2.sh parallely
  3. Check if Pro2.sh has completed its execution
  4. if yes, stop pro1.sh else continue with Pro1.sh

How can Pro1.sh and Pro2.sh be run parallelly? How can the two parallel processes communicate with each other that based on one's output other can be manipulated ? I am new to Perl and parallel programing. Thanks in advance

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
  • How much experience do you have with Unix concepts like `fork`, `exec`, processes, signals, and pipes? – amon Aug 28 '13 at 14:09
  • 1
    Your requirements intrigue me. Is Pro1.sh written such that it can be stopped without corrupting anything? Is th etiming precisely 21 minutes, or is it a particular set of work performed by pro1 that is the trigger for pro2? – Len Jaffe Aug 28 '13 at 14:12
  • 1
    [This answer](http://stackoverflow.com/questions/2423353/can-we-run-two-simultaneous-non-nested-loops-in-perl/2423413#2423413) will help you. – Zaid Aug 28 '13 at 14:14
  • Pro1 can be stopped without corrupting anything. timing is precisely 2 minutes. pro1 doesnot trigger pro2, but completion of pro2 should stop pro1 also – user2725628 Aug 29 '13 at 06:57

0 Answers0