in reply to Re: Setting an alarm
in thread Setting an alarm
Forking kids is new to me. After looking around, I came up with this:
my $pid; ... if (!stat($png)) { $SIG{'CHLD'} = "wait_for_child"; $pid = fork(); if ($pid) { "Creating thumbnail for: $pdf (pid $pid)\n"; } else { create_thumbnail($pdf,$png); exit(0); } } sub wait_for_child { print "Waiting on $pid..."; sleep(1); }
I haven't actually run the code yet for two reasons. This will generate all of them at the same time (forking a child for each PDF). And I don't have anything to check how long they are taking.
Can you add some pseudo code that would point me in the right direction?
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Setting an alarm
by ikegami (Patriarch) on Mar 10, 2010 at 17:34 UTC | |
by Rodster001 (Pilgrim) on Mar 10, 2010 at 17:59 UTC | |
by ikegami (Patriarch) on Mar 10, 2010 at 18:37 UTC |