Perlについての質問箱 60箱目
■ このスレッドは過去ログ倉庫に格納されています
5.8.0以降は割り込み処理が遅延されるようになってて、それなりに安全。
設計がクソかは知らない。
http://search.cpan.org/~rjbs/perl-5.18.1/pod/perlipc.pod#Deferred_Signals_%28Safe_Signals%29
> Perl 5.8.0 and later avoid these problems by "deferring" signals. That is, when
> the signal is delivered to the process by the system (to the C code that implements Perl)
> a flag is set, and the handler returns immediately. Then at strategic "safe" points
> in the Perl interpreter (e.g. when it is about to execute a new opcode) the flags are
> checked and the Perl level handler from %SIG is executed.
> ....
http://search.cpan.org/~rjbs/perl-5.18.1/pod/perlipc.pod#Signals
> You might also want to employ anonymous functions for simple signal handlers:
> $SIG{INT} = sub { die "\nOutta here!\n" };
■ このスレッドは過去ログ倉庫に格納されています