From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Wells Newsgroups: gmane.emacs.bugs Subject: bug#300: strange interaction of periodic timers and suspending Emacs 22.1 Date: Thu, 29 May 2008 12:50:07 +0100 Message-ID: <86y75txrbk.fsf@macs.hw.ac.uk> References: <86tzgq3ymq.fsf@macs.hw.ac.uk> Reply-To: Joe Wells , 300@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1212063134 13936 80.91.229.12 (29 May 2008 12:12:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 May 2008 12:12:14 +0000 (UTC) Cc: 300@emacsbugs.donarmstrong.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 29 14:12:53 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K1gzr-0002hY-7R for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 May 2008 14:12:43 +0200 Original-Received: from localhost ([127.0.0.1]:52334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1gz5-0008RY-Lt for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 May 2008 08:11:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K1gyz-0008Od-Tg for bug-gnu-emacs@gnu.org; Thu, 29 May 2008 08:11:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K1gyx-0008Nw-Tf for bug-gnu-emacs@gnu.org; Thu, 29 May 2008 08:11:49 -0400 Original-Received: from [199.232.76.173] (port=49700 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1gyx-0008Nt-QM for bug-gnu-emacs@gnu.org; Thu, 29 May 2008 08:11:47 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:45816) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K1gyx-0005o6-AB for bug-gnu-emacs@gnu.org; Thu, 29 May 2008 08:11:47 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m4TCBiD1012297; Thu, 29 May 2008 05:11:45 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m4TBt43c006854; Thu, 29 May 2008 04:55:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Joe Wells Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 29 May 2008 11:55:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 300 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 300-submit@emacsbugs.donarmstrong.com id=B300.12120618216435 (code B ref 300); Thu, 29 May 2008 11:55:04 +0000 Original-Received: (at 300) by emacsbugs.donarmstrong.com; 29 May 2008 11:50:21 +0000 Original-Received: from mail-r.hw.ac.uk (mail-r.hw.ac.uk [137.195.101.215]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m4TBoFL9006314 for <300@emacsbugs.donarmstrong.com>; Thu, 29 May 2008 04:50:18 -0700 Original-Received: from izanami.macs.hw.ac.uk ([137.195.13.6]) by mail-r.hw.ac.uk with esmtp (Exim 4.54) id 1K1gdt-0006rf-RQ; Thu, 29 May 2008 12:50:02 +0100 Original-Received: from selene.macs.hw.ac.uk ([137.195.27.40]:35855 helo=127.0.0.1) by izanami.macs.hw.ac.uk with smtp (Exim 4.51) id 1K1gdt-0002mn-Ek; Thu, 29 May 2008 12:50:01 +0100 Original-Received: (nullmailer pid 3628 invoked by uid 1001); Thu, 29 May 2008 11:50:07 -0000 X-c: 2008-05-29T12:42:00 D In-Reply-To: (Stefan Monnier's message of "Fri\, 23 May 2008 17\:17\:31 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-HW-MailScanner-Information: Please contact the HW Helpdesk for more information X-HW-MailScanner: Found to be clean X-HW-MailScanner-SpamCheck: not spam, SpamAssassin (score=-4.399, required 5, autolearn=not spam, ALL_TRUSTED -1.80, BAYES_00 -2.60) X-HW-MailScanner-From: jbw@macs.hw.ac.uk X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Thu, 29 May 2008 08:11:49 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:18160 Archived-At: [ 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 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.