SPUG: Pull out of a blocking subroutine?
Skylos
skylos at gmail.com
Tue Jan 12 13:26:39 PST 2010
On Tue, Jan 12, 2010 at 12:50 PM, Christopher Howard <choward at indicium.us>wrote:
> Skylos wrote:
> > On Mon, Jan 11, 2010 at 6:19 PM, Christopher Howard <choward at indicium.us
> > <mailto:choward at indicium.us>> wrote:
> >
> >
> >
> > This sounds like exactly what I need, but it doesn't seem to be
> working.
> > It still freezes at the call to Does it make any difference that I
> am
> > not making a simple system call, but instead a call to a function in
> a
> > module?
> >
> >
> > BlueComm.pm line 91 looks famliar.
> >
> > 91 eval
> > 92 {
> > 93 local $SIG{ALRM} = sub { die "alarm\n" };
> > 94 alarm 1;
> > 95 $nread = sysread $fh, $char, 1;
> > 96 alarm 0;
> > 97 };
> > 98 $rbuff .= $char;
> > 99 }
> >
> >
> > Listen to Mr. DeRykus. :)
> >
> > Skylos
> >
> >
>
> I've tried DeRykus' suggestion and it didn't seem to have any effect.
>
> I'm thinking, now that you pointed out this BlueComm.pm code, perhaps I
> can just modify this _do_cmd() function in BlueComm.pm to break after a
> certain number of tries.
>
I think its worth an experiment, but I'm sure this loops this way for some
kind of reason... like its using a non-blocking call for a blocking
situation.
Skylos
"If only I could get rid of hunger by rubbing my belly" - Diogenes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/spug-list/attachments/20100112/0fee82da/attachment.html>
More information about the spug-list
mailing list