From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#35400: 27.0.50; Timers repeated after waking from suspend Date: Tue, 02 Feb 2021 11:18:01 -0500 Message-ID: References: <834l6o4ok4.fsf@gnu.org> <87y2g6lesc.fsf@gnus.org> <83ft2e5vu1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16510"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , 35400@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 02 17:32:48 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6ybg-00048d-3B for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Feb 2021 17:32:48 +0100 Original-Received: from localhost ([::1]:46290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6ybe-0000ND-UH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Feb 2021 11:32:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6yOM-0004uA-Vc for bug-gnu-emacs@gnu.org; Tue, 02 Feb 2021 11:19:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52732) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l6yOM-0004Tk-Mi for bug-gnu-emacs@gnu.org; Tue, 02 Feb 2021 11:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l6yOM-00035v-FD for bug-gnu-emacs@gnu.org; Tue, 02 Feb 2021 11:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Feb 2021 16:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35400 X-GNU-PR-Package: emacs Original-Received: via spool by 35400-submit@debbugs.gnu.org id=B35400.161228269211834 (code B ref 35400); Tue, 02 Feb 2021 16:19:02 +0000 Original-Received: (at 35400) by debbugs.gnu.org; 2 Feb 2021 16:18:12 +0000 Original-Received: from localhost ([127.0.0.1]:36044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6yNY-00034o-Ar for submit@debbugs.gnu.org; Tue, 02 Feb 2021 11:18:12 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:18249) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6yNV-00034Y-Ax for 35400@debbugs.gnu.org; Tue, 02 Feb 2021 11:18:10 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B04F54408D2; Tue, 2 Feb 2021 11:18:03 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3EEF84408BC; Tue, 2 Feb 2021 11:18:02 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1612282682; bh=IUZVeQKVYHocrx7fqfbbS/jMhCQJ/sWc88lNJVtbajY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=C1pEJuNmLUOds99P9IDMM1cH+bkCd3aiseRY+AcBhD+D0vRIPWV2KW5RnKCQZWmoM HC+bAaHBDoXxxqihxYdu4gtj+ArFOLM9fufw7KtICgQr2AJPYgMJZrcNxcbTzqSXOG M48PH2lfpdbDDb3W/2AFI7moWXH4WYEVL39r+QnK85jnvy95gTIKKTSLNTRzhGIqcA lvNbCTP6bgQi/b51uUqHfzXYBW2+XNoIsKa4bwBxhYKRgx4VrWzdmdQV9XBG+ihG/R NfWapgi3Kz3BGrbMkNBu8wrqRiquV2WtgmkydKE3EISygjpwJ5J0xPIbOhZrzyFI1b 0I+/IxEuX86/g== Original-Received: from alfajor (76-10-182-85.dsl.teksavvy.com [76.10.182.85]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 038491200B8; Tue, 2 Feb 2021 11:18:01 -0500 (EST) In-Reply-To: <83ft2e5vu1.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 02 Feb 2021 17:32:38 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199150 Archived-At: > There are two use cases here. One is the one we have been discussing: > when Emacs wakes from suspension, or the machine wakes from sleep. > The other is that somehow Emacs didn't get CPU to run, due to some > expensive processing on the system. Or also that Emacs did get the CPU but used it for itself running ELisp code without stopping. It could even be that the code it ran was the code for an earlier invocation of that same timer. > So maybe this should be a property of the timer itself? I do think so, yes, but I think to fix it right we need to take a step back and think about what it is we really want to happen, and then see if/how we can retrofit it into the current design. I think for the case where we missed some timer repetitions, the best thing we can do is not to call that timer repeatedly but instead to call it once and pass it the number of times it has fired since the last time we ran it (so it can then freely decide to repeat its operation N times or not). A related issue is that for many timers, rather than "repeat every N seconds" we'd rather want "wait N seconds between invocations" (so if the execution of the timer terminates M seconds after the time T it was supposed to start running, the next execution should not be scheduled for T+N but T+M+N). Stefan