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.

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*