Lisp HUG Maillist Archive

LWW 5.0 and timers


I have another (newbie ?) question. Is there any way to destroy a "lost"
timer ? I have a CAPI application that is using one. If I quit the
application while the timer is running, I have not found any way to stop
it afterwards. The timer is still running, calling its callback
function. Even if I kill the background processes.

Thanks again for any clue,

-- 
Fabrice


Re: LWW 5.0 and timers

On Thu, 12 Oct 2006 15:47:26 +0200, Fabrice Popineau <Fabrice.Popineau@supelec.fr> wrote:

> I have another (newbie ?) question. Is there any way to destroy a
> "lost" timer ? I have a CAPI application that is using one. If I
> quit the application while the timer is running, I have not found
> any way to stop it afterwards. The timer is still running, calling
> its callback function. Even if I kill the background processes.

What exactly does "lost" mean?  Can you put the timers you're using on
some global list like *TIMERS*?  You could then define an action with

  (define-action "When quitting image" ...

which takes care of unscheduling all timers before the image exits.

For an example, look at the source code of LW-ADD-ONS which defines a
similar action to remove temporary files before the image exits.

HTH,
Edi.


Re: LWW 5.0 and timers

* Edi Weitz <edi@agharta.de> writes:

    > What exactly does "lost" mean? 

It means   that  up to  now,  I  could  quit  the   application  without
unscheduling the   timer. Which had  the  strange effect  that  from the
listener, I  could run a second  instance, but the  old timer  was still
calling the  callback too. Ghosts in Lisp  :-) I was  wondering if there
was a way to recover  from this situation that  can happen especially  in
the development  phase.  IE: how   are  the timers  handled? Under  what
condition are they garbaged?

    > Can you put the timers you're
    > using on some global list like *TIMERS*?  You could then define an
    > action with

    >   (define-action "When quitting image" ...

    > which takes care of unscheduling all timers before the image
    > exits.

Yes, clearly this is what I will have to do for delivering the final app.

    > For an example, look at the source code of LW-ADD-ONS which
    > defines a similar action to remove temporary files before the
    > image exits.

Thanks for the pointer.

Cheers,

-- 
Fabrice


Updated at: 2020-12-10 08:47 UTC