good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Suggestions on differentiating child processesby tmoertel (Chaplain) |
on Nov 12, 2004 at 17:52 UTC ( [id://407444]=note: print w/replies, xml ) | Need Help?? |
Have each child write its status to a pid-named file in a status
directory. When its work is complete, have it delete its file.
If you use File::Temp, the cleanup is automatic.
Then your work code can log its progress: If a worker bee gets hung up, you can observe its status from the log that corresponds to its pid. For example, I justed fired one up with pid 14416. Let's see what it is doing: Ah, it's that darn stage-three work! It always takes too long. Also, since the log files are automatically deleted upon completion, you can see what tasks are still running by listing the contents of the status-log directory. Cheers, Tom Moertel : Blog / Talks / CPAN / LectroTest / PXSL / Coffee / Movie Rating Decoder
In Section
Seekers of Perl Wisdom
|
|