develooper Front page | perl.perl5.porters | Postings from February 2003

Re: [PATCH] $SIG::UNSAFE

Thread Previous | Thread Next
From:
Gurusamy Sarathy
Date:
February 23, 2003 09:16
Subject:
Re: [PATCH] $SIG::UNSAFE
Message ID:
200302231715.h1NHFvB22630@smtp3.ActiveState.com
On Sun, 23 Feb 2003 15:09:21 GMT, Nicholas Clark wrote:
>On Sun, Feb 23, 2003 at 06:37:28AM -0800, Gurusamy Sarathy wrote:
>> Or even better yet C< $SIG{__ALL__} = 'IMMEDIATE' >?  This could
>> be extended in future to allow more specific behaviors:
>> C< $SIG{ALARM} = 'IMMEDIATE' >.
>> 
>> C< $SIG{__ALL__} = 'IGNORE' > would of course disable signal
>> handling altogether, which is something one may want to do
>> when executing unsafe code or when creating threads or when
>> running embedded in another application.
>
>I like this idea as described. But it has implications:
>
>Conceptually what happens when I go $SIG{__ALL__} = 'DEFAULT'; ?

Sets all signals to their initial (default) dispositions?

>And presumably local $SIG{__ALL__} = 'IGNORE'; restores all old signal
>handlers at scope exit?

Sure.

>In what state does
>
>{
>  local $SIG{__ALL__} = 'IGNORE';
>  $SIG{ALARM} = \&pie;
>}
>
>leave the alarm handler?

Whatever is most useful.  Perhaps the ALARM handler will still be
installed as is normally done, but will not be called within
that scope (since signals are being blocked).  Outside the scope,
it should get called on ALARM.


Sarathy
gsar@ActiveState.com

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About