in reply to "killing" perl5.8-threads

Try using alarm:
eval { local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required alarm $timeout; $nread = sysread SOCKET, $buffer, $size; alarm 0; }; if ($@) { die unless $@ eq "alarm\n"; # propagate unexpected errors # timed out } else { # didn't }

-Waswas

Replies are listed 'Best First'.
Re: Re: "killing" perl5.8-threads
by waswas-fng (Curate) on Nov 13, 2002 at 21:26 UTC
    Bah, missed the part about windows, If i remember right one of the ways to get around this was to use a SIG INT handeler and thread (or emulated fork) that kills (INT) the pid after x seconds. kinda an alarm like hack. If I can track down my code for this I will post it.

    -Waswas