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: Sun, 26 Sep 2010 20:38:39 +0200 Message-ID: <87mxr4bb9s.fsf@gmx.de> 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> <8339sztayd.fsf@gnu.org> <87tyleetju.fsf@gmx.de> <4C9DA26F.4030007@swipnet.se> <87mxr5epfa.fsf@gmx.de> <4C9E39A1.8050608@swipnet.se> <87hbhdee7k.fsf@gmx.de> <4C9F7563.3090608@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 1285526755 28022 80.91.229.12 (26 Sep 2010 18:45:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 26 Sep 2010 18:45:55 +0000 (UTC) Cc: Eli Zaretskii , kbrown@cornell.edu, 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 Sun Sep 26 20:45:51 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 1OzwEO-0007eD-5U for ged-emacs-devel@m.gmane.org; Sun, 26 Sep 2010 20:45:48 +0200 Original-Received: from localhost ([127.0.0.1]:44865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ozw7h-0001jW-UN for ged-emacs-devel@m.gmane.org; Sun, 26 Sep 2010 14:38:53 -0400 Original-Received: from [140.186.70.92] (port=35318 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ozw7b-0001gn-Lp for emacs-devel@gnu.org; Sun, 26 Sep 2010 14:38:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ozw7a-0000Oo-4R for emacs-devel@gnu.org; Sun, 26 Sep 2010 14:38:47 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:43175 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Ozw7Z-0000OR-Na for emacs-devel@gnu.org; Sun, 26 Sep 2010 14:38:46 -0400 Original-Received: (qmail invoked by alias); 26 Sep 2010 18:38:43 -0000 Original-Received: from p4FC198CB.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [79.193.152.203] by mail.gmx.net (mp022) with SMTP; 26 Sep 2010 20:38:43 +0200 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1/Xi9Az7q7XY51PetHNJshBuZCoNqF/ZK+bDskc5m pgJcN0ownezRcr In-Reply-To: <4C9F7563.3090608@swipnet.se> ("Jan =?utf-8?Q?Dj=C3=A4rv=22's?= message of "Sun, 26 Sep 2010 18:31:31 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:130928 Archived-At: Jan Dj=C3=A4rv writes: > I went ahead and added a more general file descriptor handling in > process.c, where you can add a file descriptor for reading or writing > and get a callback when I/O is possible. I then modified dbusbind to > use that so writes also are asynchronous. If the recevier wasn't > reading and Emacs writes a lot of DBus messages, a hang could occur > (not that it is very likely, dbus isn't made for passing a lot of data > around). > > So please try this version. Thanks a lot, it works for me in both the X and non-X cases. Just some minor remarks on your changes in dbusbind.c: * dbus_fd_cb calls only xd_read_queued_messages. Couldn't both functions be merged? Or, since we have the file descriptor in the callback, shouldn't we call only xd_read_message for that socket? * We assume that communication is socket base. This must not be true; see the comment in . If xd_find_watch_fd returns -1, we shall raise an error at least. > Jan D. Best regards, Michael.