From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Reading D-Bus messages Date: Fri, 24 Sep 2010 17:10:14 +0200 Message-ID: References: <878w2tx6gk.fsf@gmx.de> <4C9A493F.4050701@cornell.edu> <874odhyliu.fsf@gmx.de> <4C9B452E.1040101@cornell.edu> <4C9B63A1.2060604@cornell.edu> <87y6asy0uh.fsf@gmx.de> <4C9BBD5C.30201@cornell.edu> <83tylgtbo8.fsf@gnu.org> <871v8jhcw2.fsf@gmx.de> <4C9CB57E.1010708@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1285341083 14922 80.91.229.12 (24 Sep 2010 15:11:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 24 Sep 2010 15:11:23 +0000 (UTC) Cc: Eli Zaretskii , Ken Brown , "emacs-devel@gnu.org" To: Jan =?utf-8?Q?Dj=C3=A4rv?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 24 17:11:20 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Oz9vh-0002Ic-NC for ged-emacs-devel@m.gmane.org; Fri, 24 Sep 2010 17:11:18 +0200 Original-Received: from localhost ([127.0.0.1]:50438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oz9vg-0001uI-QQ for ged-emacs-devel@m.gmane.org; Fri, 24 Sep 2010 11:11:16 -0400 Original-Received: from [140.186.70.92] (port=52870 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oz9vZ-0001tN-O1 for emacs-devel@gnu.org; Fri, 24 Sep 2010 11:11:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oz9vY-0005g9-3F for emacs-devel@gnu.org; Fri, 24 Sep 2010 11:11:09 -0400 Original-Received: from mailrelay2.alcatel.de ([194.113.59.96]:40798) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oz9vX-0005fY-N5; Fri, 24 Sep 2010 11:11:08 -0400 Original-Received: from destgsu0048.de.alcatel-lucent.com (destgsu0048.de.alcatel-lucent.com [149.204.242.4]) by mailrelay2.alcatel.de (8.14.3/8.14.3/ICT) with ESMTP id o8OFAEOe002210; Fri, 24 Sep 2010 17:10:14 +0200 Original-Received: from slbhn1.alcatel.de (slbhn1.de.alcatel-lucent.com [149.204.90.35]) by destgsu0048.de.alcatel-lucent.com (8.12.3/8.12.3) with ESMTP id o8OFAERZ029699; Fri, 24 Sep 2010 17:10:14 +0200 (MEST) In-Reply-To: <4C9CB57E.1010708@swipnet.se> ("Jan =?utf-8?Q?Dj=C3=A4rv=22's?= message of "Fri, 24 Sep 2010 16:28:14 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Alcanet-virus-scanned: o8OFAERZ029699 at destgsu0048.de.alcatel-lucent.com X-Scanned-By: MIMEDefang 2.64 on 149.204.45.73 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130781 Archived-At: Jan Dj=C3=A4rv writes: > 2010-09-24 08:30, Michael Albinus skrev: >> Eli Zaretskii writes: >> >>> I'd rather turn the table and ask why is the call to >>> xd_read_queued_messages made in gobble_input and not elsewhere? Why >>> are we mixing input from D-Bus with keyboard input? And why in >>> gobble_input? >> >> D-Bus messages arrive asynchronously. xd_read_queued_messages() converts >> them into special events, which are stored via kbd_buffer_store_event(). >> >> gobble_input() is used, because it is called at several places, for >> instance in sit_for(), kbd_buffer_get_event(), get_input_pending(), >> ns_select() - D-Bus messages shall be handled as soon as they arrive. > > This is overkill. Not even X messages are processed this fast. > Checking for D-bus messages when the input loop is entered should be enou= gh. Yep, would be sufficient to get them the same rate as X events, for example. Somebody, who knows keyboard.c better than I do, could move the xd_read_queued_messages() call to an appropriate place. Maybe just inside kbd_buffer_get_event() ? Handling D-Bus messages like process output would not be reasonable, because one needs to requests this via accept-process-output. And there is no related process. > Jan D. Best regards, Michael.