in reply to Setting an alarm
Signals are checked after each Perl opcode is executed, and only then. Perl won't check until if a signal was received until the create_thumbnail XS functions call ends (or until it calls some Perl code, which it probably doesn't do). I'm not sure why Ctrl-C works. (Are you on Windows or unix?)
One solution is to create the thumbnails in a child process, and kill the process if it hasn't finished in the desired amount of time. Bonus: It'll provide a cleaner shutdown when a problem occurs. Bonus: It'll allow you to parallelize the process if you so desire.
You could also turn off safe signals.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Setting an alarm
by Rodster001 (Pilgrim) on Mar 10, 2010 at 17:10 UTC | |
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 |