unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Joe Wells <jbw@macs.hw.ac.uk>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 300@emacsbugs.donarmstrong.com
Subject: bug#300: strange interaction of periodic timers and suspending Emacs 22.1
Date: Thu, 29 May 2008 12:50:07 +0100	[thread overview]
Message-ID: <86y75txrbk.fsf@macs.hw.ac.uk> (raw)
In-Reply-To: <mailman.12118.1211578329.18990.bug-gnu-emacs@gnu.org> (Stefan Monnier's message of "Fri\, 23 May 2008 17\:17\:31 -0400")

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

Stefan Monnier <monnier@iro.umontreal.ca> 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.

-- 
Joe


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







  parent reply	other threads:[~2008-05-29 11:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <jwvr6bk7arz.fsf-monnier+emacsbugreports@gnu.org>
2008-05-22 19:52 ` bug#300: strange interaction of periodic timers and suspending Emacs 22.1 Joe Wells
2008-05-23 21:17   ` Stefan Monnier
     [not found]   ` <mailman.12118.1211578329.18990.bug-gnu-emacs@gnu.org>
2008-05-29 11:50     ` Joe Wells [this message]
2008-05-30  3:10   ` bug#300: marked as done (strange interaction of periodic timers and suspending Emacs 22.1) Emacs bug Tracking System

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86y75txrbk.fsf@macs.hw.ac.uk \
    --to=jbw@macs.hw.ac.uk \
    --cc=300@emacsbugs.donarmstrong.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).