Re: Re: Checking for infinite loops



On 12/6/06, hOURS <h_ours@xxxxxxxxx> wrote:

My program in a nutshell goes:
Blah blah blah the beginning part
require someprogramthatmayhaveaninfiniteloop.pl
Blah blah blah the ending part

You must have a good reason for using a buggy library without first
fixing its bugs.

How would one add alarm to this such that the ending part gets executed
regardless?

It's difficult to live up to the word "regardless", especially so when
alarm is involved. As an alternative, have you considered using a
child process to do the long-running calculation? It can get stuck in
an infinite loop, but your parent process isn't. Your parent process
can check each second whether the child has finished until N seconds
have elapsed; then the parent sends SIGHUP to the child and it's done.

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training
.



Relevant Pages

  • Re: Will Orth-C replace Ortho-K -- for Ace
    ... raphaelson blah blah blah. ... But the OD has the child read a poorly illuminated ... i recommend following the doctors advice instead of some nutcase who ... PROVEN scientific fact that otis will not accept and instead claims ...
    (sci.med.vision)
  • Re: B&B Lets Hope...
    ... That will seal the deal with Brooke going back to Nick. ... blah blah blah" I wonder ... > Brooke should be charged with child endangerment, abandonment, child ...
    (rec.arts.tv.soaps.cbs)
  • Re: B&B Lets Hope...
    ... That will seal the deal with Brooke going back to Nick. ... blah blah blah" I wonder ... > Brooke should be charged with child endangerment, abandonment, child ... I wish it had been RJ in the drain. ...
    (rec.arts.tv.soaps.cbs)
  • Re: Caylee Marie Anthonys mother held on $500,000 bond
    ... guess is the Grandma was abusive to the child and may be the one that ... it's doubtful the help came from the grandma. ... Casey is clearly adept at manipulating her. ... blah blah blah sound like buttons Casey has lots of ...
    (alt.true-crime)
  • Re: Caylee Marie Anthonys mother held on $500,000 bond
    ... guess is the Grandma was abusive to the child and may be the one that ... it's doubtful the help came from the grandma. ... I was just listening to the jail house tapes between Casey and her mom. ... blah blah blah sound like buttons Casey has lots of ...
    (alt.true-crime)