From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#4954: 23.1; Emacs hangs when two run-at-time calls in effect Date: Thu, 19 Nov 2009 00:36:34 +0100 Message-ID: References: <4B0415BC.9010400@ufl.edu> Reply-To: Lennart Borgman , 4954@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1258588077 27460 80.91.229.12 (18 Nov 2009 23:47:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Nov 2009 23:47:57 +0000 (UTC) To: Sullivan Beck , 4954@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 19 00:47:49 2009 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 1NAuFT-0005Wz-NI for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 00:47:44 +0100 Original-Received: from localhost ([127.0.0.1]:37718 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAuFS-0002RI-MO for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Nov 2009 18:47:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NAuFM-0002Qc-2I for bug-gnu-emacs@gnu.org; Wed, 18 Nov 2009 18:47:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NAuFG-0002Mk-JU for bug-gnu-emacs@gnu.org; Wed, 18 Nov 2009 18:47:34 -0500 Original-Received: from [199.232.76.173] (port=33861 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAuFG-0002MZ-E5 for bug-gnu-emacs@gnu.org; Wed, 18 Nov 2009 18:47:30 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:44629) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NAuFF-0003yK-9D for bug-gnu-emacs@gnu.org; Wed, 18 Nov 2009 18:47:29 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAINlKTk015145; Wed, 18 Nov 2009 15:47:21 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nAINj4FU014364; Wed, 18 Nov 2009 15:45:04 -0800 Resent-Date: Wed, 18 Nov 2009 15:45:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Lennart Borgman Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Wed, 18 Nov 2009 23:45:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4954 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4954-submit@emacsbugs.donarmstrong.com id=B4954.125858742110420 (code B ref 4954); Wed, 18 Nov 2009 23:45:04 +0000 Original-Received: (at 4954) by emacsbugs.donarmstrong.com; 18 Nov 2009 23:37:01 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mail-yw0-f179.google.com (mail-yw0-f179.google.com [209.85.211.179]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAINaxgW010417 for <4954@emacsbugs.donarmstrong.com>; Wed, 18 Nov 2009 15:37:00 -0800 Original-Received: by ywh9 with SMTP id 9so1556358ywh.19 for <4954@emacsbugs.donarmstrong.com>; Wed, 18 Nov 2009 15:36:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=gKKtgtkYXHjiFffDcXQVdrp2nvtZZcf84+ePn0yynQY=; b=FCgtyJv0cLb1legEdcdblDHD4N7skjLxPV/eE7qXdHDdwmOFvzE/doUVl2d7kWcyq9 CAv+Sz9NfALM2KwgbBWuYLTw+nU1/6rwEFw1DZFbx4/N0BOXESqaWgN8rYBepOW4Xf5H vAB/EGu4mqEwdcfzbQrNktFZUkv2Fp46fBMZA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=Tu+1xcTHbvPTc64hryCv66QR471hnnl0eqaeGyghbMLpDjIf4VSRuK+VVAIDVDBmq9 /T56XzqEkqMO19+DGWo6urXWH6YO8oGGe10l2ogdbkSp15HTB3ZzIo7QVkJRO5FceWRa ISossiyQiqJRXOfDXOPVgx18ALbj0zWWRqGmM= Original-Received: by 10.101.179.23 with SMTP id g23mr3418999anp.171.1258587414163; Wed, 18 Nov 2009 15:36:54 -0800 (PST) In-Reply-To: <4B0415BC.9010400@ufl.edu> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Wed, 18 Nov 2009 18:47:34 -0500 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:32692 Archived-At: On Wed, Nov 18, 2009 at 4:41 PM, Sullivan Beck wrote: > I wrote two simple emacs extensions, both of which use the run-at-time > function periodically write some information to a file. When one or the > other is loaded, emacs works fine. When both are loaded, emacs will work > fine for a while, and then suddently start behaving very sluggishly. > Keyboard input will not be printed on the screen for 2-4 seconds. It > never seems to recover (though the periodic work should only take a > fraction of a second) and eventually, I have to kill emacs and restart. > > I'll include both extensions below, though I don't believe that either > of them are directly related to the cause of the problem... it just > happened that they both use run-at-time. Hi Sullivan, I do not know what causes the hang, but I can guess. In both your extensions you are saving data to a file. I wonder if that operation is syncronous? If it is then all Emacs can do is to wait there. (File operations can be both async and sync and I do not know what Emacs is doing.) A way to work around the trouble is perhaps to rewrite your scheduling of the saving operations. Here is one suggestion: - Instead of saving immediately in the timer start a second timer with run-with-idle-timer. - In that timer do the saving. This makes the chance that the saving will occur while you are typing a bit smaller, but it does not avoid the trouble totally.