[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#300: strange interaction of periodic timers and suspending Emacs 22.
From: |
Stefan Monnier |
Subject: |
bug#300: strange interaction of periodic timers and suspending Emacs 22.1 |
Date: |
Fri, 23 May 2008 17:17:31 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
> When Emacs 22.1 resumes from being suspended, it will execute a
> periodic timer once for each time it would have executed it if Emacs
> had never been suspended. The same thing happens when the entire
> computer is suspended (i.e., hibernation (suspend to disk) or sleep
> (suspend to RAM)).
I seem to remember a discussion about this a couple years ago.
Does anybody remember something about it?
> While it is conceivable that some uses of timers might prefer the
> current behavior, in the vast majority of cases a timer does a
> recurrent task and there is no benefit from repeating the timer
> zillions of times in a row. In fact, this can cause Emacs to freeze
> for a long time when resuming due to processing periodic timers if the
> timers do significant work.
Yes, that sounds like a problem. Do you have an actual case where this
currently happens? We have enough real-life problems to fix, so if this
problem is only theoretical it's less likely to get fixed soon.
> In addition to wanting to see this problem fixed, I would also be
> interested to hear of a reliable way to work around it.
A reliable way is to make your timer non-repeated and instead to re-arm
it manually at its end. This also helps when your timer takes more time
to process than its expected frequency.
Stefan