I'm creating an embedded Perl library for an environment which has its own set of signal handlers. I can't seem to find an explicit description of how to safely merge Perl's (v5.8) signal handling with that environment (nothing mentioned in perlembed or perlcall). The nearest search hit I've found is Apache::SIG, but I'm ignorant of mod_perl internals.
Does anyone know of a reference to describe how to deal with signal handlers in such an environment ? I.e.,
I'm writing a library to install a Perl interpretter into an existing application framework (ala mod_perl). Said framework has its own set of signal handlers, some of which have very important functions to safely rollback the actions of plugins (such as I'm writing), esp. wrt cleaning up memory.
However, if I rely on the framework's current signal handlers, which usually do some heap cleanup then longjmp() back to a known state, its quite likely that my embedded Perl will be left in a confused state. So I'd like to be able to use Perl's "safe" signal handling (dispatching between opcodes), and then rollback safely in an "eval-ish" sortof way. After which, I can dispatch back to the original signal handler.
Hence, I need to understand how an embedded Perl is going to treat existing signal handlers.
Final Empirical Update:
After hacking up some code to verify, here's the results: (WinXP, AS Perl 5.8, using SIGINT, using simple sleep() and simple print/printf() signal handler):
Note that (3) is probably dangerous, as it presumably is equivalent to unsafe signals, ie, Perl possibly left in a bad state. I'll probably have to borrow Perl's signal queueing code to restore sanity.
In reply to Signal handling in embedded Perl ? by renodino
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |