[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#300: strange interaction of periodic timers and suspending Emacs 22.

From: Joe Wells
Subject: bug#300: strange interaction of periodic timers and suspending Emacs 22.1
Date: Thu, 29 May 2008 12:50:07 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

[ I am not cc-ing this to address@hidden on the theory that
  sending this to address@hidden will also get it sent
  to address@hidden  I am guessing this is the cause of all
  the duplicates showing up in the gnu.emacs.bug newsgroup. ]

Stefan Monnier <address@hidden> writes:

>> 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)).
>> 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.

The case that bugs me enough to care is that I have a timer that
invokes desktop-save roughly every 5 minutes.  (My scheme is a bit
more clever than that and tries to save during idle times, but if it
can't save during an idle time it will still ensure the desktop file
is saved at least every 5 minutes.)  My desktop file is quite big
because I include in desktop-globals-to-save some variables that have
very large values, so it takes 2 to 3 seconds to save this file.  If I
suspend my computer for 20 hours, when I wake it up Emacs wants to do
desktop-save 240 times, which can easily take several minutes.

I hope this information is helpful.


Heriot-Watt University is a Scottish charity
registered under charity number SC000278.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]