Re: Signal issues.




On Dec 31, 2004, at 6:59 AM, Jan Hudec wrote:

On Thu, Dec 30, 2004 at 20:09:57 -0500, muppet wrote:

Here's something from one of my apps that needs to have special SIGINT
handling at certain times.
...
Ouch, that's ugly :-(.

indeed.


I just solved it with POSIX::sigaction, which does not try to be clever.
But I meant something like this:
...
That is, just add a special source, that will be checked in every iteration, it will look at the signal flag in perl interpreter and if it's set, it will just make a dummy call to the interpreter to let it handle the signal. Minimal overhead and no need to hack about with %SIG and things like that. This option was not mentioned in the message cited above.

my only reluctance here is that PERL_ASYNC_CHECK() (the macro perl calls after every op to check for deferred signals) and PL_sig_pending (the global var/macro that PERL_ASYNC_CHECK uses) are not part of the official perl API and could change out from under us. ... of course, we're already using a few of those undocumented tricks in other places, so it's probably not the end of the world.

i'll play with this over the weekend and see what i can come up with.

--
muppet <scott at asofyet dot org>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]