From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#53432: [PATCH] Avoid losing keyboard input when inotify is too busy [and 1 more messages] Date: Mon, 24 Jan 2022 18:52:20 +0200 Message-ID: <83fspdjcu3.fsf@gnu.org> References: <25067.17249.604070.872185@chiark.greenend.org.uk> <838rv8nua8.fsf@gnu.org> <87r190wqo1.fsf@yahoo.com> <25068.23625.512978.147194@chiark.greenend.org.uk> <87a6fntgfh.fsf@yahoo.com> <25069.23134.887206.241281@chiark.greenend.org.uk> <877daqtnkw.fsf@gmx.de> <25069.40682.688423.883151@chiark.greenend.org.uk> <87lez5ry92.fsf@gmx.de> <83k0epji6b.fsf@gnu.org> <87h79trvt6.fsf@gmx.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29240"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, 53432@debbugs.gnu.org, ijackson@chiark.greenend.org.uk To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 24 17:54:31 2022 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 1nC2bu-0007MS-Pi for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Jan 2022 17:54:30 +0100 Original-Received: from localhost ([::1]:60654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nC2bt-00042t-S2 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Jan 2022 11:54:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2aU-0003Ub-KH for bug-gnu-emacs@gnu.org; Mon, 24 Jan 2022 11:53:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nC2aU-00041g-Af for bug-gnu-emacs@gnu.org; Mon, 24 Jan 2022 11:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nC2aU-0002zY-9X for bug-gnu-emacs@gnu.org; Mon, 24 Jan 2022 11:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jan 2022 16:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53432 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 53432-submit@debbugs.gnu.org id=B53432.164304316311473 (code B ref 53432); Mon, 24 Jan 2022 16:53:02 +0000 Original-Received: (at 53432) by debbugs.gnu.org; 24 Jan 2022 16:52:43 +0000 Original-Received: from localhost ([127.0.0.1]:45520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC2aB-0002yy-IX for submit@debbugs.gnu.org; Mon, 24 Jan 2022 11:52:43 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC2aA-0002yf-02 for 53432@debbugs.gnu.org; Mon, 24 Jan 2022 11:52:43 -0500 Original-Received: from [2001:470:142:3::e] (port=41224 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2a4-0003zx-9i; Mon, 24 Jan 2022 11:52:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=+5iuL5MjudhL3dDwBE2uOFdp6KeWsVPFzjtFTNMbQCk=; b=CHMknGk4G97w kHhyMcJp2fjPjr701BMImADnIKqfIT/sTw2F5xq9OA9X3j4m4qy922i7H0O3lwneT7DQrhqI2Wqce 0XOMHR3X+C9eIgMnXxRfKGZAcVPtckg5J/aQKmSxDp0L1zFBoBhet4fGddtHtnZnsBEQHA5vdb04p C2w9O0CXoSZwLsUN3VgKIWb6AHY/EU2MkyfpKvkFAXAE03ivcsZuTXAI/WUnCAcrub+gXrDKTBD24 syIHJ5UbO8hc4P9eCp+Cx7/U8bHejO9Y/Vvpc8r6bG/BU16bRwh20pw6WNr5JTuwBY2TLWhP0Yklp etMj5q37PHmrP6GA/v0/bA==; Original-Received: from [87.69.77.57] (port=4810 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nC2a3-0000NI-Gt; Mon, 24 Jan 2022 11:52:36 -0500 In-Reply-To: <87h79trvt6.fsf@gmx.de> (message from Michael Albinus on Mon, 24 Jan 2022 16:35:17 +0100) 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:225077 Archived-At: > From: Michael Albinus > Cc: ijackson@chiark.greenend.org.uk, luangruo@yahoo.com, > 53432@debbugs.gnu.org > Date: Mon, 24 Jan 2022 16:35:17 +0100 > > >> The advantage of splitting into "keyboard" and "other things" buffers > >> would be, that the keyboard buffer doesn't overrun, whatever burst of > >> D-Bus or file notification events arrives. > > > > But the disadvantage is that we will immediately be facing a problem > > of priority in handling input from more than one source. > > "Key strokes first!" :-) But it isn't only the key strokes, it's also all the events sent to us by the window-system. Now tell me why, say, an expose event should be more important than a file-notification event, and not the other way around? > An alternative approach could be to restrict how many burst events are > put into the beyboard buffer. Let's say that D-Bus and file notification > events are allowed to fill that buffer until (KBD_BUFFER_SIZE - 512) > events (arbitrary number). This would let place for key strokes, mouse > events and alike. That's what Po Lu was suggesting, AFAIU: limit the number of queued file-notification events to not more than some threshold.