New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getting alarm() to work within threads #5872
Comments
From @lizmatCreated by @lizmatIf you try to do alarms within a thread, and $SIG{ALRM} was not Alarm clock being sent to STDERR. It bombs in such a way that I'm not able This behaviour can be circumvented by assigning $SIG{ALRM} with Further investigations reveal that assigning in a surrounding This shows it all: # alarm.pl
use threads;
$SIG{ALRM} = 'a' if @ARGV; # must assign outside of threads
threads->new( sub {
$SIG{ALRM} = sub { die "alarm went off properly\n" };
eval {
alarm( 3 );
1 while 1;
alarm( 0 );
};
warn "\$\@ = $@";
} )->join; $ perl alarm 1 $ perl alarm Perl Info
|
From green@FreeBSD.orgI'm noticing the same thing on FreeBSD with local $SIG{ALRM} assignment |
From @jhiI must point out that saying "getting alarm() to work with threads" is very |
From @lizmatAt 15:42 +0000 2/6/03, Jarkko Hietaniemi (via RT) wrote:
Too bad. However, it does seem to work under Linux... but that's
This is really too bad, as there are particular applications that you I guess I will need to spend some more time on forks.pm again... ;-) Liz |
From @schwern0 ~$ bleadperl ~/tmp/test Is that an improvement? :) That's bleadperl@25129 on OS X 10.3.9 |
From @lizmatTo be quite honest, I've given up on threads in Perl 5. Signals and threads in Perl are the Wild West, really, last time I checked.... |
This issue can be closed as far as I'm concerned. |
Quite so, I'm afraid. |
Migrated from rt.perl.org#16807 (status was 'open')
Searchable as RT16807$
The text was updated successfully, but these errors were encountered: