Anders Johnson <ajohnson@wischip.com> writes: >Incidentally, there are some related issues that I've recently >discovered: > >+ If a signal is received just as you're changing its disposition from a >handler to DEFAULT, then the signal could get deferred until after the >disposition changes, which generally results in badness. (I already have >a patch for this one.) If the signal had arrived slightly later (machine busier) it would have gone to DEFAULT handler - so changing handlers when signals maybe in the pipe is source of the "badness". > >+ It's still not safe for a signal handler to die() (which is otherwise >very useful), because it can prevent a DESTROY method from doing its >job. (This is analogous to the "destructors must never, ever throw" rule >in C++. See http://www.gotw.ca/gotw/047.htm .) Can you explain some more? > >I think that fixing the second issue requires adding some >critical-section support to Perl itself. (Perhaps a $^E variable that >inhibits signal sampling and is automatically set locally for any >DESTROY and STORE methods that get called on behalf of a block exiting.) >If such a thing were to exist, then you could certainly call my test >case contrived, since you could then use "local $^E=1;" to accomplish >basically the same thing. > >Of course, I'm all ears if you have any better ideas. I'm particularly >fond of any solution that doesn't require modifying the Perl core, so >long as it's clean and robust. > >Thanks, >&ers -- Nick Ing-Simmons http://www.ni-s.u-net.com/