Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Builtin Watchdog for a sub (or block)

by PetaMem (Priest)
on Apr 28, 2002 at 18:02 UTC ( [id://162693]=note: print w/replies, xml ) Need Help??


in reply to Re: Builtin Watchdog for a sub (or block)
in thread Builtin Watchdog for a sub (or block)

Yes - basically this goes to the right direction. However I had some problems with the code and am not able to solve them all.
  • I guess theres a ; missing after the eval block
  • It would be nice to have finer granularity than 1 sec. probably Timer::HiRes can do here something.
  • I wasn't able to find out what return value alarm has... somehow the code always boils out with an alarm.
  • Quite frankly - I don't understand the "parent alarm" thing.

Bye
 PetaMem

  • Comment on Re: Re: Builtin Watchdog for a sub (or block)

Replies are listed 'Best First'.
Re: Re: Re: Builtin Watchdog for a sub (or block)
by ehdonhon (Curate) on Apr 29, 2002 at 04:43 UTC
    I guess theres a ; missing after the eval block

    Yes, thank you.

    Quite frankly - I don't understand the "parent alarm" thing.

    This was my answer to your request for an algorithm that could recursively call itself. Say $oldalarm is 3 and $givetime is 20. Even though cheatmail may have 20 seconds to complete its task, you know that somewhere higher in the callstack, you have another watchdog (which I refer to as a 'parent') that is expecting to be done one way or another in 3 seconds. Using this algorithm, you know that whichever watchdog is expecting to be done in 3 seconds will be the one to receive the alarm signal.

Re^3: Builtin Watchdog for a sub (or block)
by particle (Vicar) on Apr 29, 2002 at 13:47 UTC
    • It would be nice to have finer granularity than 1 sec. probably Timer::HiRes can do here something.
    it's Time::HiRes (not Timer::HiRes.) if you don't want to add the overhead of a module, you can use select, as in select('','','',$time); instead.

    ~Particle *accelerates*

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://162693]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-23 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found